Help tracking down “EXC_BAD_ACCESS”
I have an iPhone 3.0 Utility App template that I was adding fields to the FlipsideViewController nib/h/m files which somehow got stuck with an error telling me it could not find a definition for protocol FlipsideViewControllerDelegate. I finally gave up after commenting out nearly the entire module.
I then copied in new FlipsideViewController.h/.m files and cut and pasted in all my earlier changes and verified that all the same connections were present as in a blank Utility App, and my additional IBOutlet and IBActions.
Now, when I click on the (Done) button, I get the “EXC BADACCESS”.
Tracing in gdb, with breakpoints shows it completes
- (IBAction)done {
[self.delegate flipsideViewControllerDidFinish:self];
}in FlipsideViewController.m, which includes
- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller {
// removed 3.0 line to use flip, so can build with 2.2.1 base SDK
[self dismissModalViewControllerAnimated:YES];
}
and not sure where to put the next breakpoint, it does the transition, then gets the exception.
So my screen shows the MainView window as expected.
All of this WAS working fine, before I added the additional IBOutlet/IBAction and had the protocol issue. It's possible an IBOutlet/Action is setup wrong, or dropped, but those usually show up with the wrong datatype sent to an instance. In this case, I just get the “EXC BADACCESS”. The stack backtrace is not really helpful in identifying where else to look.
(gdb) bt
#0 0x90a1a68c in objc_msgSend ()
#1 0x00005b96 in -[Scenes dealloc] (self=0x529eb0, _cmd=0x90a5b514) at /Volumes/Olorin/Projects/Pusher/Scenes.m:83
#2 0x00004046 in -[MainView dealloc] (self=0x525b00, _cmd=0x90a5b514) at /Volumes/Olorin/Projects/Pusher/Classes/MainView.m:229
#3 0x922bc38a in CFRelease ()
#4 0x92289709 in __CFDictionaryDeallocate ()
#5 0x922bc538 in _CFRelease ()
#6 0x91725f6f in __delayedPerformCleanup ()
#7 0x922b96db in CFRunLoopTimerInvalidate ()
#8 0x922ba629 in CFRunLoopRunSpecific ()
#9 0x922baaa8 in CFRunLoopRunInMode ()
#10 0x31566600 in GSEventRunModal ()
#11 0x315666c5 in GSEventRun ()
#12 0x30a4eca0 in -[UIApplication _run] ()
#13 0x30a5a09c in UIApplicationMain ()
#14 0x00002c28 in main (argc=1, argv=0xbfffef08) at /Volumes/Olorin/Projects/Pusher/main.m:14
Any pointers will be appreciated.
PB Ti G4 1Gh 10.5.7 768M, 15" iMac G4 800Mh 10.3.9 768M DM9 1.6Gh 10.5.7 2G, Mac OS X (10.5.7), PM8600/300Mhz MacOS 9.0 513M, PM8500/132/405Mhz 10.1 Server, Centris 650, Quadra