user542584
user542584

Reputation: 2699

presentModalViewController not working

I have a navigation controller based application. There are a number of view controllers. The method pushViewController:animated: works fine and the view controllers are pushed correctly.

However, presenting a modal view controller from the viewcontroller or navigation controller like below does not work. The code does not give any errors, and executes in debugging, but the screen is not shown.

I tried

[self presentModalViewController:vc animated:YES];

and

[self.navigationController presentModalViewController:vc animated:YES];

Appreciate any pointers please!

Upvotes: 0

Views: 663

Answers (1)

QED
QED

Reputation: 9933

The code you posted looks fine. Make sure vc.modalTransitionSyle is set to something reasonable, make sure vc is not nil in presentModalViewController:animated. If you're targeting 5.x and ignoring 4.x, you should move to the newpresentViewController:animated:completion idiom, the others are on their way out of service.

Upvotes: 1

Related Questions