Titanium Community Questions & Answer Archive

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

help with orientation

Hi everybody

i am new to titanium and was hoping someone could get me started by telling me what I am doing wrong here. For some reason the subwindows does not show up.

Hope someone can help me out

git clone git://gist.github.com/707353.git gist-707353

— asked November 19th 2010 by Dennis Nielsen
0 Comments

2 Answers

  • This is the error i am getting:

    
    [INFO] Compiling JavaScript...one moment
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:23
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:56
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:91
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:133
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:168
    [INFO] One moment, building ...
    [INFO] Titanium SDK version: 1.4.2
    [INFO] iPhone Device family: ipad
    [INFO] iPhone SDK version: 3.2
    [INFO] Launching application in Simulator
    [INFO] Launched application in Simulator (1.82 seconds)
    [INFO] Application started
    [INFO] Alpha/1.0 (1.4.2.bf53f9)
    [ERROR] Script Error = Result of expression 'win' [null] is not an object. at app.js (line 58).
    2010-11-19 20:05:50.710 Alpha[9380:207] The view controller <TiRootViewController: 0x6527c90> returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation.
    [INFO] Application has exited from Simulator
    
    — answered November 19th 2010 by Dennis Nielsen
    permalink
    0 Comments
  • Hi Dennis

    It's very bad etiquette to paste large amounts of code (nearly 400 lines!). Please use gist next time. Anyway, it's much more considerate to create the simplest test case that will exhibit the behaviour, as it takes the burden of of the helper.

    The errors output tell you most of the problems, namely:

    Correct the syntax (or get a js validator like eclipse to help you):

    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:23
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:56
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:91
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:133
    [WARN] JavaScript compiler reported "Missing semicolon." at app.js:168
    

    You have referenced a variable named "win" that does not exist. What you mean is "win1", around line 58:

    [ERROR] Script Error = Result of expression 'win' [null] is
    not an object. at app.js (line 58).
    

    I am not sure about this one, but you have to resolve the other problems before you can troubleshoot it.

    2010-11-19 20:05:50.710 Alpha9380:207 The view controller
    TiRootViewController 0x6527c90 returned NO from
    shouldAutorotateToInterfaceOrientation for all 
    interface orientations. It should support at least one orientation.
    

    If the log does not give you more informative about the last error, even after you have resolved the above, then we will have to rethink the approach. I presume you are rotating the view, which then triggers the exception?

    The other, dirty, strategy you could use is try commenting out bits of code and launching until you have found the bit that causes it.

    — answered November 19th 2010 by Paul Dowsett
    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.