Random EXC_BAD_ACCESS
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?
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?
Perhaps some code excerpts from where you're calling the settings view would help...
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?
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?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| EXC_BAD_ACCESS | Holyhoppsan | 2 | 3,322 |
Aug 10, 2010 01:44 PM Last Post: Holyhoppsan |
|
| Why I recive EXC_BAD_ACCESS | Rincha | 11 | 3,948 |
Sep 16, 2009 01:55 PM Last Post: maximile |
|
| EXC_BAD_ACCESS in objc_msgSend | saltwater | 3 | 3,573 |
Sep 7, 2009 01:24 PM Last Post: saltwater |
|
| EXC_BAD_ACCESS Sound error | wonza | 5 | 3,484 |
Jan 26, 2009 03:35 AM Last Post: wonza |
|

