Titanium Community Questions & Answer Archive

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

Random crash on tab change

This is more a tip than a question.

My app started crashing -mostly in the simulator- at random moments, usually just after showing the splash screen or changing tabs, no error message or anything shown in Titanium, just "Application exited from simulator". Launching my app in the simulator through XCode, when the crash occured I was getting the following error in the console:

*** -[NSArray initWithObjects:count:]: attempt to insert nil object at objects[6]

I have totally no idea what this means.

Anyway, I was so desperate I had to use my app's backup files from 2 days ago.

Starting with app.js, I started comparing the old and current file. The only difference I spotted was the barImage:'images/nav_bar.png' in the tabs' windows. I removed these from my current app.js file and suddenly the app stopped crashing.
It seemed so weird I put them back in and the app started crashing again.

I've seen this error showing up to other people in here too (splash-crash error etc), and it seems to be getting fixed with so random solutions.

For me that made the trick. I hope I could help.

— asked October 21st 2010 by George Marmaridis
  • attempt
  • change
  • crash
  • insert
  • nil
  • object
  • objects[]
  • random
  • splash
  • tab
0 Comments

1 Answer

  • It's a race condition which I think Appcelerator have fixed in the current dev code. In your case changing that line may have adjusted the timing just enough to stop the bug from triggering, but I don't believe setting the bar image is the root cause. In my app I was frequently able to trigger that bug in the simulator by switching back and forth between windows in a tab group.

    — answered October 21st 2010 by Damien Elmes
    permalink
    1 Comment
    • They have fixed it? Then why would the bug still be triggering?
      And yes I'm sure barImage wasn't the root cause as well. I would really want to know what the real cause is and what I can do to fix it permanently.

      — commented October 21st 2010 by George Marmaridis
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.