Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23917] iOS: popToRootWindow( ) method returns undefined is not a function error

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionInvalid
Resolution Date2016-09-18T10:37:11.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterJebun Naher
AssigneeEric Merriman
Created2016-09-18T06:41:52.000+0000
Updated2017-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.

Comments

  1. Hans Knöchel 2016-09-18

    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])
  2. Lee Morris 2017-03-24

    Closing ticket as invalid with reference to the above comments.

JSON Source