Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems loading and saving images from camera and camera roll. What am I doing wrong?
    text
    copied!<p>I am building an app in which you can make pictures or pick an image from the camera roll and save these inside the app to be displayed in a tableview and detailview. The problem is that when I make a picture from inside the app and save it, the tableview and detailview get terribly slow as if the app is freezing. I also get this error ": CGAffineTransformInvert: singular matrix.". When I load a picture from the camera-rol that was not taken from inside my app, there is no problem and the app runs very smouthly.</p> <p>This is the code for when I open the camera and camera roll:</p> <pre><code>-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ if (buttonIndex == actionSheet.cancelButtonIndex) { return; } UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsEditing = NO; switch (buttonIndex) { case 0: if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { picker.sourceType = UIImagePickerControllerSourceTypeCamera; } break; case 1: if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) { picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; } break; } [self presentModalViewController:picker animated:YES]; } </code></pre> <p>This is where I save it to the camera roll and put the image in an imageView:</p> <pre><code>-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType]; UIImage *mijnImage; if (CFStringCompare((__bridge_retained CFStringRef)mediaType, kUTTypeImage, 0)==kCFCompareEqualTo) { mijnImage = (UIImage *) [info objectForKey:UIImagePickerControllerOriginalImage]; mijnPlaatje_.image = mijnImage; UIImageWriteToSavedPhotosAlbum(mijnImage, nil, nil, nil); } [picker dismissModalViewControllerAnimated:YES]; </code></pre> <p>}</p> <p>And here I save the image inside my app:</p> <pre><code>-(IBAction)save:(id)sender{ drankjes.plaatje = [mijnPlaatje_ image]; [self dismissModalViewControllerAnimated:YES]; </code></pre> <p>}</p> <p>What am I doing wrong?</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