Hi I have gone through many question on SO this too but its not helping me for ios 5.1.1.When i take image for first 2 times its working fine then n3rd time the app shows memory warning and gets crashed.Here is my code:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
if (image) {
if ([appdel.arrImageData count]==0) {
count=0;
}
count++;
[appdel.arrImageData addObject:[image copy]];
}}
Any help would be appreciated.
Each time you take a picture, you keep a copy of it in arrImageData and so filling up memory until iOS kills you app since you take too much memory. Re-think your design so you keep only one image in memory. If you need all the pictures for what ever reason, save it in the documents or cache directory and clean memory before taking another picture.