28 Oct 2011, 8:46pm

1 comment

UIImagePickerController freezing/hanging in XCode 4.2

The UIImagePickerController docs say: “The delegate methods are responsible for dismissing the picker when the operation completes. To dismiss the picker, call the dismissModalViewControllerAnimated: method of the parent controller responsible for displaying the UIImagePickerController object.”

Following other docs, one would think the most reliable way to do this would be [[picker parentViewController] dismissModalViewControllerAnimated:YES]; (which calls dismissModalViewControllerAnimated of the parent controller).

However, in in XCode 4.2 this is no longer possible. NB. I say XCode4.2 here, and I mean XCode 4.2. This is unrelated to the iOS version, but rather the XCode version. I had code working on 4.0, 4.3 and 5.0 in XCode 4.1 which fails when built on XCode 4.2.

So instead, use whatever controller you presented the viewcontroller on to dismiss it too. [parentController dismissModalViewControllerAnimated:NO];. The old way worked pre XCode 4.2. But when you upgrade to XCode 4.2 it will suddenly return nil – causing the UIImagePickerController to not be dismissed, and thus effectively hanging.

This also seems to work, but isn’t really what the docs suggest. [picker dismissModalViewControllerAnimated:NO];.

Thanks to Omil for the tip.

Great tip. Thanks!

 
*name

*e-mail

web site

leave a comment


 

free winrar download

free winrar download

winrar download free

winrar download free

windows 7 key generator

windows 7 key generator

windows 7 activation crack

windows7 activation crack

free winzip

free winzip

free winrar

free winrar

winzip free download

winzip free download

winrar free download

winrar free download

windows 7 crack

windows 7 crack

winzip free download full version

winzip free download full version

winzip activation code

winzip activation code

windows 7 product key

windows 7 product key
\n