[TIMOB-23917] iOS: popToRootWindow( ) method returns undefined is not a function error
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-09-18T10:37:11.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Jebun Naher |
Assignee | Eric Merriman |
Created | 2016-09-18T06:41:52.000+0000 |
Updated | 2017-03-24T18:02:20.000+0000 |
Description
When I call popToRootWindow method on my NavigationWindow instance, I get an error telling me it's undefined function.
*Test Case:*
var i = 0;
var MAX_WINDOWS = 3;
var nav = Ti.UI.iOS.createNavigationWindow({window: createWindow(++i)});
nav.open();
function createWindow(num) {
var win = Ti.UI.createWindow({title: "Window " + num, backgroundColor: "#fff"});
var btn = Ti.UI.createButton({title: (i == MAX_WINDOWS) ? "Close all windows" : ("Open Window " + (num + 1))});
win.addEventListener("close", function() {
Ti.API.warn("Closing " + this.title);
});
btn.addEventListener("click", function() {
if (i == MAX_WINDOWS) {
nav.popToRootWindow();
i = 0;
return;
}
nav.openWindow(createWindow(++i));
});
win.add(btn);
return win;
}
*Steps to reproduce the issue:*
- Run the sample code on simulator.
- Click on Open Window 2 button
- Next, click on Open window 3 button
Now click on Close all windows button and it'll return following error:
[ERROR] : message = "undefined is not a function (evaluating 'nav.popToRootWindow()')";
*Helpful link:*
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.iOS.NavigationWindow-method-popToRootWindow
Thanks.
The
popToRootWindow
method is (like stated in the docs) only available in Titanium SDK 6.0.0 that is not released, yet. But it is another reminder to us that we should only publish docs of the current branch, not for unreleased software (cc [~cng] [~bimmel])Closing ticket as invalid with reference to the above comments.