DidFinishPickingMediaWithInfo not called after receiving memory warnings

I use UIImagePickerViewController to take photos in my application, but in iOS4 +, which supports multitasking, I ran into a memory problem. If you have opened many applications, and then mine, UIImagePickerViewController no longer works. The pickup controller closes several times without calling the delegate method, sometimes the whole application crashes. From coz, memory warnings have already been received, but what can I do? Reject pickerController when receiving a 1st memory warning and warn the user that he should kill as many suspended applications as possible and try again? Is this really not a pleasant user experience? But if I do not, crashing or closing the pickerController abruptly also confuses the user. Has anyone met and solved the same problem?

+3
source share
1 answer

UIImagePickerViewController is known for throwing memory warnings. If you do not want to be sure that everything is ready for unloading, if you receive these warnings, I recommend that you switch to the AV Foundation instead.

This SO answer has a link to a tutorial that can help you get started in that direction. AVFoundation camera tutorial

0
source

Source: https://habr.com/ru/post/1793564/


All Articles