Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

iPad doesn't know what a window object is??

I only have two lines of code in my app.js file and I get an error.

The standalone window example in the Kitchen Sink runs just fine in the iPad simulator but when I copy and run the same code my app it doesn't work.

Titanium 1.2.1,
iPhone SDK 3.2

// code
var win = Titanium.UI.currentWindow;
win.backgroundColor = 'pink';
// error
[ERROR] Script Error = Result of expression 'win' [null] is not an object. at app.js (line 2).
— asked May 13th 2010 by Kelly Redd
  • ipad
0 Comments

2 Answers

  • Accepted Answer

    You need to create a window first.

    — answered May 13th 2010 by Damien Elmes
    permalink
    0 Comments
  • thx damien. i knew it had to be an operator error ;) for some reason i was thinking i had a default current window on start up.

    — answered May 13th 2010 by Kelly Redd
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.