poms32
poms32

Reputation: 37

Javascript error on Appcelerator Titanium

I'm facing an issue with Appcelerator Titanium. I have the following code :

var navInit = Ti.UI.iOS.createNavigationWindow();

And later:

navInit({window : applicationWindow})

where applicationWindow is a TI window.

When I compile I get this error :

Object is not a function (evaluating 'navInit(.....)');

I can't see what is the problem and how to solve it.

Thanks for the help

Upvotes: 0

Views: 90

Answers (2)

kopiro
kopiro

Reputation: 709

Documentation is clear about the usage.

var win2 = Titanium.UI.createWindow({
    backgroundColor: 'red',
    title: 'Red Window'
});

var win1 = Titanium.UI.iOS.createNavigationWindow({
    window: win2
});

win.open();

http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.iOS.NavigationWindow

Upvotes: 2

ceejayoz
ceejayoz

Reputation: 180136

Ti.UI.iOS.createNavigationWindow() returns an object, not a function. You can't execute it.

To update its window after creation, use navInit.setWindow(applicationWindow); instead.

Upvotes: 2

Related Questions