I've gotten stung by a bug that I just can't figure out how to debug. Basically I run my code on the simulator and everything is just fine.
When I go to the actual device however, I get a EXC_BAD_ACCESS error. Unfortunately, when running on the phone under the debugger the damned thing works just fine, so I have no way to judge where the error is occurring.
I did get one stack trace that I couldn't reproduce, so I'm pretty sure that the line in my code that is causing the problem is this one (but I can't for the life of me figure out how it could be):
[[NSNotificationCenter defaultCenter] postNotificationName:@"SubscriberChanged" object: nil];
The actual error was on an objc_msgSend about four frames below this line, but its in code that appears to be part of the iPhone SDK, so I don't have the source to inspect it.
Can anyone give me a few pointers on how I might go about figuring out where this problem is? I have a deadline to ship this thing and I can't let it go out like this...
Thanks
--Steve
I finally managed to reproduce this in the debugger. The stack trace I get is as follows:
#0 0x30011940 in objc_msgSend ()
#1 0x3054dc80 in _nsnote_callback ()
#2 0x3024ea58 in _CFXNotificationPostNotification ()
#3 0x3054b85a in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#4 0x3054dbc0 in -[NSNotificationCenter postNotificationName:object:] ()
#5 0x000027c6 in -[My2CentsAppDelegate handleMOCChange:] (self=0x1159d0, _cmd=0x2bf90, notification=0x147400) at /Users/sdussin/Desktop/UPOD Research LLC/Development/My2Cents/Classes/My2CentsAppDelegate.m:52
#6 0x3054dc80 in _nsnote_callback ()
#7 0x3024ea58 in _CFXNotificationPostNotification ()
#8 0x3054b85a in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
Frame #5 in the stack trace corresponds to the line above.