Dealing with UIImagePickerController to minimize memory useage
So, I have read the SO post on UIImagePickerController, UIImage, Memory and More, and I read the post on Memory Leak Problems with UIImagePickerController in iPhone. I have VASTLY increased my memory efficiency between these 2 posts, and I thank the OPs and the people that provided the answers.
I just had a question on the answer provided in the Memory Leak question, which was (essentially):
only have one instance of the controller throughout the programs runtime
What would be the best way to go about this without causing memory leaks? Right now I am initiating it and releasing it on every use from within the view, and I am seeing exactly what the answer describes (Memory warnings and a crash after about 20 uses). Should I initiate the UIImagePickerController
when I need it, but use a seperate class unrelated to the view to control it? How should I deal with rele开发者_JAVA百科asing the controller if I do it this way?
--EDIT--
As per the answer, the leak was fixed. My crashes must be coming from poor memory management. Posted a new SO question here to account for the new question topic.
Stick it in your application delegate.
I'm pretty sure this leak was fixed in OS 3 though.
精彩评论