Solution-iphone - UIImagePickerController memory warning("Received memory warning") | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

Solution-iphone - UIImagePickerController memory warning("Received memory warning")

Friday

Iphone crash report - Low Memory Warning:  while using UIImagePickerController :
                                                                                              In one of my Iphone project I've  a UIImagePickerController as a synthesized property of my view controller. In general it works fine  for taking/picking photos.  If  I choose/take photos continuously  then I received a memory warning and  the UIImageView become empty(without image).  Some times the app was automatically closed.  I have tried to setting self.imageView.image = nil in viewDidUnload but I got the same "Received memory warning" message. Finally I got the following solution from web.
                   The  solution for UIImagePickerController memory warning is the imagePicker/imageView  wasn't being set to nil in viewDidUnload, but  it needed to remove/dismiss it in didReceiveMemoryWarning method.



Issue:

Solution:
-(void)didreceivememorywarning {
// Release anything that's not essential, such as cached data (meaning //instance variables, and what else...?)

self.imageView.image = nil;

// Releases the view if it doesn't have a superview
[super didReceiveMemoryWarning];

}

                      


0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets