Posts: 1
Joined: 2009.02
Post: #1
Hey guys,
I'm completely stuck.
I'm finishing a quite large iphone project and only a few dialogs left, everything else works fine. And this is a problem!
Ok, so I've got "settings" button in the main menu in my app, and when you tap it, a new dialog (class inherited from UIView) should appear. The thing is when you tap it, the app crashes _sometimes_. Sometimes it works well, the dialog appears as I want to and works pretty fine.
It crashes in a random place, with random stack, and the only thing the debugger says is Program received signal: “EXC_BAD_ACCESS”.
I've rewritten the dialog completely from scratch, it had no effect.
Yes, I have tried GuardMalloc - nothing, NSZombies - nothing.
Maybe you have any ideas?
Quote this message in a reply
Posts: 12
Joined: 2009.01
Post: #2
Perhaps some code excerpts from where you're calling the settings view would help...
Quote this message in a reply
Posts: 32
Joined: 2008.10
Post: #3
Lock, lock, and just to be sure, lock again. When in doubt, lock.

By lock, I mean protect the rendering thread with a semaphore/mutex/whatever. Dont render in the background while Cocoa is doing something funky in the foreground (especially with dialogs/modal windows).

Also, some Apple components are buggy as hell. For example, dont enable accelerometer and UIImagePicker at the same time, otherwise you'll crash (learned this the hard way).

Try to revert to a state where you wern't crashing, add components until you find something which doesn't jibe well with the other components. Then lock.

Did I say Lock?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Thread 4: EXC_BAD_ACCESS cmhubert 2 4,905 Sep 29, 2013 07:26 AM
Last Post: mawigator
  EXC_BAD_ACCESS Holyhoppsan 2 8,654 Aug 10, 2010 01:44 PM
Last Post: Holyhoppsan
  Why I recive EXC_BAD_ACCESS Rincha 11 9,923 Sep 16, 2009 01:55 PM
Last Post: maximile
  EXC_BAD_ACCESS in objc_msgSend saltwater 3 7,408 Sep 7, 2009 01:24 PM
Last Post: saltwater
  EXC_BAD_ACCESS Sound error wonza 5 7,300 Jan 26, 2009 03:35 AM
Last Post: wonza