Using UIImagePickerController started to give sigabrt crashes when UIImagePickerControllerSourceTypePhotoLibrary is selected as source type. Other source types works fine but I need PhotoLibrary as source type. What could be the reason?
1 Answers
After trying many many things, this answer (UIImagePickerController crashes app on iPad but not iPhone) helped me to understand that there might be a problem with the landscape and portrait mode.
I am testing it on iPhone (iOS9) and I was not allowing Portrait mode. The problem was uiimagepickercontroller does not support landscape mode for UIImagePickerControllerSourceTypePhotoLibrary as the source type and crashes.
If you want to stick to landscape mode and use uiimagepickercontroller, you need to set the source type to UIImagePickerControllerSourceTypeSavedPhotosAlbum.
Another possible solution is to develop a custom view to show pictures instead of using uiimagepickercontroller. The sample code from Apple can help for this: https://developer.apple.com/library/ios/samplecode/UsingPhotosFramework/Introduction/Intro.html#//apple_ref/doc/uid/TP40014575-Intro-DontLinkElementID_2
-
1Another solution use popOverView to present imagePickerView for ipad – Yagnesh Dobariya Feb 27 '16 at 11:28