I\'ve referred to this very good reference: https://stackoverflow.com/questions/1282830/uiimagepickercontroller-uiimage-memory-and-more but I\'m having some very serious issues.
Most likely you are using uneditted images, and they come back at full blown size of 1400x1300 which is huge and w ill crash your app, i suggest resizing the pictures to the iphone native 320x480 resolution, should fix your problem
For all the people that are still looking for the actual answer and not a vague statement then look here. I noticed there are hundreds of answers such as "Handle your memory" but that doesn't answer anything. Hope this helps someone else out there...
Change the following
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
[imageView setImage:image];
[self dismissModalViewControllerAnimated:YES];
}
To the following so your modal view dismisses before setting your image...
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
[self dismissModalViewControllerAnimated:YES];
[imageView setImage:image];
}
Yes, this happens. The thing to remember is that it's okay to get a memory warning, it doesn't mean you're a bad person, you just need to make sure that your application doesn't crash or get confused in response to the memory warning.
In particular, you need to understand that the default action of UIViewController is to unload its views if they're not visible, and they won't be visible if the full-screen image picker is showing.