Note that there are some explanatory texts on larger screens.

plurals
  1. POApp crashes when taking photo UIImagePickerController
    text
    copied!<p>My app crashes when I try to take more than one picture using UIMagePickerController. So, first time I take a picture everything is fine, second time around the app crashes without any error messages. I do get this the first time around:</p> <pre><code>2013-01-11 16:36:24.178 DoodleStash[26778:907] Received memory warning. </code></pre> <p>Here's the code I am using to take a photo:</p> <pre><code>- (IBAction)takePhoto:(id)sender { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage, nil]; [self presentViewController:imagePicker animated:YES completion:nil]; self.isNewDoodle = TRUE; }} </code></pre> <p>And here's what I use to save the photo</p> <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType]; [self dismissViewControllerAnimated:YES completion:nil]; if ([mediaType isEqualToString:(NSString *) kUTTypeImage]) { self.doodleImage = [info objectForKey:UIImagePickerControllerOriginalImage]; // Check to make sure the image is new if (self.isNewDoodle == TRUE) { UIImageWriteToSavedPhotosAlbum(self.doodleImage, self, @selector(image:finishedSavingWithError:contextInfo:), nil); } [self performSegueWithIdentifier:@"confirmUploadSegue" sender:self]; }} </code></pre> <p>Really appreciate any help on this. Complete code is here <a href="https://gist.github.com/4515007" rel="nofollow">https://gist.github.com/4515007</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload