I am very new to developing iPhone and Objective-C. Today I found out how to open a new ViewController and how to return to the previous one.
Here's how I do it now:
// In the main view controller, I have an openSecondView method, which is defined as follows:
- (void) openSecondView:(id)sender {
SecondViewController *secondView = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:secondView animated:YES];
}
// In SecondViewController, I have a return button that calls the closeView method, which is defined as follows:
- (void)closeView:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
My question is: how do you do it right?
[release ] presentModalViewController - ? , , , , presentModalViewController, , , , , , , rejectModalViewControllerAnimated. - [release ] presentModalViewController?
/ .