简体   繁体   中英

dismissModalViewControllerAnimated also dismisses the view controller that calls it

I've got a view controller which is presented as a modal view controller on startup by the delegate. This view controller has an option to select an image using a UIImagePickerController which is presented using presentModalViewControllerAnimated . After this I implement the

imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 

method and call dismissModalViewControllerAnimated on it, but this dismisses both of the modal view controllers. I can't seem to keep the first view controller open when the second is closed.

Who are you calling dismissModalViewControllerAnimated on? You want to call it on the view controller that presented the modal view you want to dismiss.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM