Titanium Community Questions & Answer Archive

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

Log Shows App Termination But App Continues To Run

Hi All

I have very strange issue.

My app is throwing this error in Titanium as soon as the app is run:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSArray initWithObjects:count:]: attempt to insert nil object at objects[4]'

The app continues to run in the simulator. Although now, no log messages appear after the crash.

I have compiled via Xcode and when I attach debugger the app rarely but randomly throws the error and crashes. I have played with app in simulator and device both in debug and release mode without a change in results. The error is only ever thrown immediately when launched via Titanium.

I am unable to debug using the stack trace as its fairly generic.

Any ideas what could be causing this?

Cheers,

Nick

— asked August 17th 2010 by Nick The Geek
  • crash
  • iphone
  • nsinvalidargumentexception
0 Comments

4 Answers

  • Okay, the plot thickens.

    Even if delete the build/iphone directory and replace my app.js with the default new project app.js, Titanium throws the error when the app is launched.

    Cheers,

    Nick

    — answered August 17th 2010 by Nick The Geek
    permalink
    0 Comments
  • check out any loops closed perfectly or not & use db.close if it is open in any function

    — answered August 17th 2010 by Varun Atluri
    permalink
    1 Comment
    • Thanks for the suggestion but I have already checked this.

      All of my db functions are consolidated into single libDB.js file and are all opens are closed correctly.

      I have checked all my loops and they seem fine. I will check again though.

      — commented August 17th 2010 by Nick The Geek
  • check out any loops closed perfectly or not & use db.close if it is open in any function

    — answered August 17th 2010 by Varun Atluri
    permalink
    0 Comments
  • I copied out my Resources directory. Deleted the project. Created a new project of same name and copied back.

    It now compiles correctly and executes without error from TiDeveloper.

    I note that TiDev now says "[INFO] Found 4.0.1 patch installed" which has not appeared before.

    The rare crash after Xcode compile is probably due to different fault elsewhere.

    — answered August 17th 2010 by Nick The Geek
    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.