I’m new to mobile development with Titanium Studio. I was using tabgroup controller and it was working fine with IOS simulator version 5.1. But when I upgraded to IOS 6, when I tried running the same code I got the error below,
Script Error = -[UITabBarController setSelectedViewController:] only a view controller in the tab bar controller's list of view controllers can be selected. at app.js (line 45).
And here is my code:
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
navBarHidden: true,
tabBarHidden: true,
url:'example.js',
});
var tab1 = Titanium.UI.createTab({
height: 30,
window:win,
});
tabGroup.addTab(tab1);
tabGroup.addEventListener('open', function(){
tabGroup.setActiveTab(tab1);
})
tabGroup.open();
Please tell me if I can do something to solve it. Or if I can downgrade the simulator to 5.1 because I don’t find the IOS simulator 5.1 in Run Configuration.
Thanks in advance.
This is fixed by updating your titanium SDK to the latest version. (Currently 2.1.3 RC2 http://developer.appcelerator.com/blog/2012/09/titanum-2-1-3-rc2-is-released-with-additional-fixes-for-ios-6-and-iphone-5.html)
I had the same issue and this fixed it for me.