How do I replace a modal view controller?

Posted by Theory on Stack Overflow See other posts from Stack Overflow or by Theory
Published on 2010-03-29T06:04:45Z Indexed on 2010/03/29 6:13 UTC
Read the original article Hit count: 628

I'm using a modal view controller to allow a user to select an address book entry and email address. The ABPeoplePickerNavigationController object is displayed via presentModalViewController:animated:

[self presentModalViewController:picker animated:YES];

What I want to do is keep the modal dialog up, but when the user selects the email address, it should cross-fade to a different controller that displays a message composition window.

I've tried various approaches in peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier: to dismiss the picker and set my custom composition controller as the modal view. I can do it any number of ways, but never does it fade smoothly from the picker to the composition controller -- unless I make the composition controller a modal dialog of the picker, in which case the picker re-appears when I dismiss the composition controller. I don't want that, either.

There must be some way to smoothly replace one controller and its view with another controller and its view, all within the context of a modal dialog, and preferably with a cross fade. Suggestions greatly appreciated.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiviewcontroller