[TIMOB-23721] iOS: Invalid method (createTabGroup) passed to UIModule
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2016-10-03T19:54:03.000+0000 |
Affected Version/s | Release 5.4.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | qe-5.4.0 |
Reporter | Harry Bryant |
Assignee | Hans Knöchel |
Created | 2016-08-03T19:09:46.000+0000 |
Updated | 2017-08-16T01:06:37.000+0000 |
Description
The following error is thrown when calling the createTabGroup method without specifying any tabs:
[WARN] : Attempted to load TiUITabGroupProxy: Could not find class definition.
[ERROR] : Script Error {
[ERROR] : column = 49;
[ERROR] : line = 1;
[ERROR] : message = "invalid method (createTabGroup) passed to UIModule";
[ERROR] : sourceURL = "file:///var/containers/Bundle/Application/4971331A-066C-4C17-BA2D-3DC44E634884/ShamWise.app/app.js";
[ERROR] : stack = "[native code]\nfile:///var/containers/Bundle/Application/4971331A-066C-4C17-BA2D-3DC44E634884/ShamWise.app/app.js:1:49";
[ERROR] : }
The issue is resolved when specifying at least one tab as follows:
var tabGroup = Ti.UI.createTabGroup();
var tab1 = Ti.UI.createTab({
title: "Tab1"
});
tabGroup.add(tab1);
tabGroup.open();
*This occurs only on the iOS platform, the demo code launches without issue on the Android platform.*
TEST CODE:
var tabGroup = Ti.UI.createTabGroup();
tabGroup.open();
Wait a second, you are trying to add a tab to the tabgroup that does not hold a window in it. Without it, the tabgroup has no context and could break. Check if that could be the reason. *EDIT*: In addition, it is
addTab
and notadd
. *EDIT2*: Ok, here is the thing why it doesn't work for you but me / iOS devs: The above code does not have a tab in it. After some research I found out that our implementation is the following (simplified):What that does is, that it only compiles the
TiUITabGroup
class if aTiUITab
is defined. Since all compiler-macros are pre-defined in the Xcode source-project, [~cng] and me didn't see the error before. For the compiled SDK, those macros are generically generated as soon as you doTi.UI.createTab()
at least once, we also call it "symbols". So long story short: That is how it is done since forever, since we don't want users to create empty tabgroups. If we want now, we can make it an improvement-ticket, otherwise, that's it.[~htbryant] Resolving for now, since I didn't hear anything back since a while. If you think we need an improvement ticket, I'd be fine with that!
Closing with reference to the above comments.