I've got some code that creates and presents a modal view controller. I'd like to use UIModalTransitionStyleFlipHorizontal as the modalTransistionStyle, but when I test the code on an iPhone 3G, it gives me EXC_BAD_ACCESS.
Here's my code:
UIViewController *controller;
switch (self.showWhichView) {
case previousView:
// do nothing; we're already here
return;
break;
case showReflectionsList:
controller = [[ReflectionsListViewController alloc] initWithNibName:@"ReflectionsListView" bundle:nil];
break;
case showHelp:
controller = [[HelpViewController alloc] initWithNibName:@"HelpView" bundle:nil];
break;
case showSettings:
controller = [[SettingsViewController alloc] initWithNibName:@"SettingsView" bundle:nil];
break;
default:
break;
}
// Reset this flag so the menu works as expected the next time we use it
self.showWhichView = previousView;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];
If I set modalTransistionStyle to anything other than the default UIModalTransitionStyleCoverVertical, I get the bad access message. Does anyone have any ideas about what might be causing the issue?
The Base SDK is iPhone Device 4.0, but the OS version of the iPhone is 3.1.2.
Update: I discovered the very useful "NSZombieEnabled" variable, which as promising as it sounds (and is in most circumstances), did NOT give me a message indicating what object caused the EXC_BAD_ACCESS.