Hello
I am running my application through xcode's static analyzer and it pointed out that I had a potential leak in a file:
MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
So after the code I do [delegate release]
. This results in an EXC BAD ACCESS when the view controller I am doing this in pushes a new view controller onto the navigation stack. If I comment this out, it's fine.
I have run through the debugger and it doesn't actually crash when the delegate reference is released, but just when the next controller is pushed.
It isnt the code which runs between the declaration and the release as I tried commenting it out to see what happens.