UIImagePickerController Shows Huge Memory Leak and Crashes my App

Hi,


I'm writing an app with UIImagePickerController.


It's been working very well, but from today, and only on iPad, UIImagePickerController shows dramatic memory leak and causes my app crashes.


The image picker is set to present only images with Photo Library style. I have about 10,000 photos in my photo library, but I don't think the amount of my photos or my code are the culprits. Because not only do I believe there are a lot of people who have more photos in their library, but also does my code work correctly, without memory leak, on iPhone.


I tested this on more than one iPad, and the same happened.


The memory leak occures as soon as I present UIImagePickerController and it takes up about 400~700 MB of memory in less than a second.


My app recieves several memory warning and terminates. Xcode shows that the app is terminated due to memory error.


It is really strange that the exact code worked yesterday.


I'm running iOS 8.4, I tested this on iPad Air, Air 2, iPhone 5s.


I tested this on a new blank project and the result was the same.


Any help would be really appreciated. Thanks in advance.

The documentation for UIImagePickerController says

https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIImagePickerController_Class/

The table indicates that on iPad, if you specify a source type of UIImagePickerControllerSourceTypePhotoLibrary or UIImagePickerControllerSourceTypeSavedPhotosAlbum, you must present the image picker using a popover controller, as described in Presenting and Dismissing the Popover. If you attempt to present an image picker modally (full-screen) for choosing among saved pictures and movies, the system raises an exception.


and later also says

The UIImagePickerController class supports portrait mode only.


Is it possible that you are running into one of these issues?

First of all, Thanks for your interest.


I wrote my code by the reference. I used popover and just tested this issue on portrait and landscape mode.


I came to know that ,on my iPads, apps that uses image picker crashes as soon as present the image picker as popover. So I'm guessing there is some mysterious issue in my photo album that crashes apps on only iPads. I'm going to test this again after deleting my photos from my iPads.


Thank you!

UIImagePickerController Shows Huge Memory Leak and Crashes my App
 
 
Q