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!
The code you posted looks fine. Make sure
vc.modalTransitionSyleis set to something reasonable, make surevcis notnilinpresentModalViewController:animated. If you’re targeting 5.x and ignoring 4.x, you should move to the newpresentViewController:animated:completionidiom, the others are on their way out of service.