Recreating "presentModalViewController"?

Posted by Benjohn Barnes on Stack Overflow See other posts from Stack Overflow or by Benjohn Barnes
Published on 2010-05-27T13:12:17Z Indexed on 2010/05/27 13:31 UTC
Read the original article Hit count: 271

Filed under:

I'm using a UIImagePickerController set up as a camera with an overlay view.

I want to present a modal view controller on top on this. When I do so, though, the camera view "closes". This would be okay, but when I dismissModalViewControllerAnimated, I see the closed camera, and there is a long and annoying delay before it reopens. I would like to avoid this.

Unless someone has a better approach, I am planning to simply perform the transition that presentModalViewController would perform myself. However, if I take my modal view from it's controller and add it as a sub view of the camera overlay view, like this:

[[_imagePickerController cameraOverlayView] addSubview: [viewController view]];

then the modal view doesn't show up at all, and the application crashes with an EXC_BAD_ACCESS in my "modal" view's layoutSubViews.

Where as, if I present it with presentModalViewController, everything works fine. Clearly, presentModalViewController is also doing some other stuff. Does anyone know what this is so that I can recreate it?

© Stack Overflow or respective owner

Related posts about iphone