I have a function in the controller that looks like this:

Code:
	loadView : function(viewName) {


		var view = Ext.create('TOMobile.view.' + viewName);
		
		TOMobile.MainContent.removeAll(true);
		
		TOMobile.MainContent.add([view]);
		var lastid = TOMobile.MainContent.getItems().length - 1;
		TOMobile.MainContent.setActiveItem(lastid);
	}
It simply takes a view name, and creates it and adds it to a card layout. This works fine in my development directory. When I build this in to a test and the code is compiled in to one file, it doesn't work. There are no errors thrown, it simply does not show the view. In stepping through the code, the view is created and added to the card panel, so I know all the code is in the build. Any ideas?