Andrew
Andrew

Reputation: 16051

Remove modalViewController from view?

I have a view which pulls in another view using this code:

secondView = [[SecondView alloc] init];

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:secondView];
navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

[self presentModalViewController:navigationController animated:YES];
[navigationController release];

The cancel button on this 2nd view has this:

[self.navigationController.modalViewController dismissModalViewControllerAnimated:YES];

But it doesn't appear to do anything. The view is still there and I can still interact with it. How do i remove it?

Upvotes: 2

Views: 3064

Answers (1)

Joris
Joris

Reputation: 6286

try:

[self.navigationController dismissModalViewControllerAnimated:YES]

Upvotes: 9

Related Questions