Titanium Community Questions & Answer Archive

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

Uncaught exception when repeatedly opening windows in 1.3.2

I have a TableView with some rows that open a new child window when clicked. If I open and close these child windows for about 30 seconds or so, I eventually get an uncaught exception that crashes the application:

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

Has anyone else run into anything like this? I wish I could go back to 1.2.0 to see if it also occurs there (I don't remember it ever happening), but ever since I installed iPhone SDK 4.0, I'm unable to test in 1.2.0.

— asked July 14th 2010 by Mike Dosey
5 Comments
  • I get this as well - does your child window have a tableview in it?

    — commented July 15th 2010 by Chris Reed
  • mine does have a tableview in it.

    — commented July 15th 2010 by Ian Duchesne
  • So does mine. Chris, are you able to test in 1.2.0?

    — commented July 16th 2010 by Mike Dosey
  • Afraid I'm unable to go back (due to SDK 4.0) But I'm fairly sure it wasn't. Is the child tableView 'grouped' by any chance? Mine are.

    — commented July 17th 2010 by Chris Reed
  • Yes, my tableViews are also grouped.

    — commented July 19th 2010 by Mike Dosey

14 Answers

  • Accepted Answer

    I gave this another bash yesterday and successfully ran 20 cycles of open/close with the latest build, so I think it's sorted with a recent fix.

    cheers,
    Chris.

    — answered July 21st 2010 by Chris Reed
    permalink
    0 Comments
  • I get the same problem and it's driving me crazy… I go back an forth about 4-5 times and the application crashes.

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

    [INFO] Titanium SDK version: 1.3.2
    [INFO] iPhone Device family: iphone
    [INFO] iPhone SDK version: 4.0

    — answered July 15th 2010 by Ian Duchesne
    permalink
    2 Comments
    • Does 16 happen to be the number of rows that are in your grouped tableview? In my exception, it says "nil object at objects[4]", which is how many rows are in my tableview.

      — commented July 19th 2010 by Mike Dosey
    • No I have 20 rows in the table. Not sure what 16 means.

      I wish I/we could have some help to solve this.

      — commented July 20th 2010 by Ian Duchesne
  • I haven't able to get back to 1.2.0. I will do some tests on the iphone itself to see if the problem persists there. Not sure if someone has a solution out there?

    — answered July 15th 2010 by Ian Duchesne
    permalink
    0 Comments
  • I'm not using RowAnimationstyle and have unique classnames for each row… so I guess that isn't the problem.

    — answered July 15th 2010 by Ian Duchesne
    permalink
    0 Comments
  • At least it's not just me, then. Are you able to test in 1.2.0 to see if the problem still occurs there? It'd be helpful to narrow down if the problem is specific to 1.3.2.

    — answered July 15th 2010 by Mike Dosey
    permalink
    0 Comments
  • Nevermind, double post

    — answered July 15th 2010 by Daniel Lim
    permalink
    0 Comments
  • tripled post : now i know how that happended. LOL

    — answered July 15th 2010 by Daniel Lim
    permalink
    0 Comments
  • i have tableview open child crashing issues on 1.3.2 and the RowAnimationstyle turned out to be the curpit, not sure it's related ti your problem. I have yet tried it on 1.3.3

    http://developer.appcelerator.com/question/42491/132-bug—tableview-crashed-on-rowanimationstyle

    — answered July 15th 2010 by Daniel Lim
    permalink
    0 Comments
  • Argh, I'm still having this error spontaneously pop up. Unfortunately, I don't see an existing bug ticket for this crash. Has anyone had any luck finding out the specific cause or at least a workaround?

    — answered July 17th 2010 by Mike Dosey
    permalink
    0 Comments
  • Has anyone else encountered this problem? Any thoughts on a possible work-around?

    — answered July 19th 2010 by Mike Dosey
    permalink
    0 Comments
  • Still can't figure this out!

    — answered July 20th 2010 by Mike Dosey
    permalink
    0 Comments
  • whoops, forgot the 404 posts anyway.

    Keep moving folks, nothing to see here.

    — answered July 21st 2010 by Chris Reed
    permalink
    0 Comments
  • whoops, forgot the 404 posts anyway.

    Keep moving folks, nothing to see here.

    — answered July 21st 2010 by Chris Reed
    permalink
    0 Comments
  • I think I solved the problem. Here is what I did

    I followed the steps from this post:
    http://stackoverflow.com/questions/2436238/xcode-internal-error-occurred-while-creating-dependency-graph

    That helped instead of crashing at every 4-6 row clicks it crashed at 20-22 row clicks.

    I then decided to run/build the project in Xcode. That seemed to do the trick, it hasn't crashed after about 60 row clicks… It still doesn't explain the cause or if this will actually solve the problem.

    This seems to be the best solution for now.

    Hope this helps you.

    — answered July 21st 2010 by Ian Duchesne
    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.