Dealing with UIImagePickerController to minimize memory useage

Posted by Gordon Fontenot on Stack Overflow See other posts from Stack Overflow or by Gordon Fontenot
Published on 2010-06-11T18:00:53Z Indexed on 2010/06/11 18:02 UTC
Read the original article Hit count: 375

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 releasing the controller if I do it this way?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about memory-management