I have a view controller I’m storing into a mutable array.
- (void)pushViewController:(KAViewController *)viewController
{
[self.viewControllers addObject:viewController];
if (self.count == 0)
[self.view addSubview:viewController.view];
else
[self transitionFromView:self.currentViewController.view toView:viewController.view];
}
The array (viewControllers) is defined as:
@property (nonatomic, retain) NSMutableArray *viewControllers;
The view has a button, and when I click on it I get the following message:
[KAGameInfoViewController performSelector:withObject:withObject:]:
message sent to deallocated instance 0x6e6e900
I’ve confirmed that 0x6e6e900 is the address to my view controller.
Any thoughts?
EDIT
Turning off ARC fixing the problem.
Probably
self.viewControllersis nil because you forgot to do:anywhere.