I've an iPad app that can call the 2nd viewController by pressing a next button. But when I press the next button, it is successfully called the 2nd viewController but when I press return the program quits (Program received signal). Anything wrong with my Xcode4 ?
.m mainController
-(IBAction) next{
UIViewController * about = [[UIViewController alloc] initWithNibName:@"about" bundle:nil];
[self presentModalViewController:about animated:YES];
[about release];
}
.m 2nd viewController
- (IBAction)btnReturn {
[self.view removeFromSuperview];
[self dismissModalViewControllerAnimated:YES];
}
- (void)dealloc
{
[UIViewController release];
[super dealloc];
}
These two lines make no sense, you should remove them:
[self.view removeFromSuperview];
[UIViewController release];
Line 1: You don't have to remove your view from the superview. Dismissing the modal controller should be sufficient.
Line 2: If anything, you should release an object, not a class.