iOS 6.1 WTF: -[UIViewController removeFromParentViewController] overreleases ?!?!!?!
- Create a new Xcode iOS Application project "Single View Application". Do not use Storyboards, do not use Automatic Reference Counting, do not use Include Unit Tests. Choose as Device the iPad.
- Put the following code in your ViewController.m file
- (void) viewDidLoad { UIViewController *controller; [super viewDidLoad]; controller = [[UIViewController alloc] initWithNibName:nil bundle:nil]; [self addChildViewController:controller]; [controller release]; [controller removeFromParentViewController]; }
- Edit your scheme "Product -> Scheme -> Edit Scheme..." in the Diagnostics Tab to Enable Zombie Objects.
- Compile, run and crash.
2013-06-27 10:41:27.086 TestUIViewControllerReleaseBug[1594:c07] *** -[UIViewController _parentViewController]: message sent to deallocated instance 0x7121ff0