Using iOS 3.2/4.0/4.2 with Titanium 1.7.0 RC1 & 1.7.0 GA.
We are trying to create a simple TabGroup with 5 tabs on iOS. The code works perfectly on the simulator. But when it is loaded on the device, we get the following error:
invalid method (createTabGroup) passed to UIModule
We tried rebuilding by cleaning the build folder, tried referencing the TabGroup before calling it and other workarounds suggested by this Q&A post - but no luck.
However we did notice that 1.7.0 RC1 doesn't have this problem on the device. To be doubly sure, we used the app.js from KitchenSink and retained only the TabGroup creation code:
Resources/app.jsTitanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup({id:'tabGroup1'});
// tabGroup.open();
- Both GA & RC1 work flawlessly on the simulator.
- 1.7 GA: Fails on device with the invalid method error.
- 1.7 RC1: Works on device.
Does anybody have any solutions/workarounds for this bug?
2 Answers
How are you installing to the device? The only thing I can suggest is instead of using studio Go in to the build/iphone folder and double click on the project. Select the correct target and press Cmd+R. This assumes that you have the profile and everything set up for your app to run on your device.
Maybe show us some more code? You don't show where you have tabs with windows or other content in your tab group, so you haven't showed us any code that does anything.
When you create a new project, it has code in it that is a tabgroup with two tabs. Can you get this 'blank project' to run on the device? It works fine for me.
We found a workaround for this issue. We just had to mention Ti.UI.createTab in app.js & the same code started working on 1.7 GA on the device!
So our guess is that during the build process, presence of Ti.UI.createTabGroup alone isn't enough to trigger the inclusion of the TabGroup module - we need to mention Ti.UI.createTab too (which does make sense).
P.S.: We did have both of these in a platform-specific .js file under the Resources/iphone directory - but the build process doesn't seem to include modules mentioned in that file which is why we had to mention those modules in app.js in the first place.
Your Answer
Think you can help? Login to answer this question!