I have a MainWindowController that I want to close on "touch inside" button event and open a new UIView. The code that I use is this:
NewViewController *controller = [[NewViewController alloc]
initWithNibName:@"NewView" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];
But in this way the MainWindowController don't close it self.
Try this one
[self dismissViewControllerAnimated:YES completion:nil];