tags:

views:

30

answers:

1

Hi all,

How to display 2 modal view controllers on iphone one after another?

Please help

+1  A: 

You just call presentModalViewController again from within the previously modally presented viewcontroller. This way you may even add more than one viewcontroller, building a stack. When you dismiss one modally presented viewcontroller in the middle of this stack, all of its "child" modal viewcontrollers will be dismissed too. However they all disappear at once, only the topmost view controller is transitioned out.

See the discussion on -dismissModalViewController in UIViewController Class Reference

Toastor
Hey, Thanks for the answer. How to display first->second->again first->again second modal view controllers ?(i.e. 1st and 2nd modal view controllers one after another)
imMobile
Present the first vc, when the user takes some action on the first present the second vc. Dismiss the second vc to get back to first - you can do that by calling [self dismissModalViewControllerAnimated:YES]; within the second VC. It will then be transitioned out and first is visible again.
Toastor
Hi, I tried doing the same, on DidCancel event.The 2nd modal view dismisses and the view controller screen is displayed, but the 1st vc does not appear on screen. Please help
imMobile