I've had a custom photo app built and am now trying to fix an error/bug. In 2.2 the app functions perfectly, but in 3.1 the application crashes when attempting to take a picture.
In 2.2, when I hit the shutter release button, after a moment an image is saved to the photo library. In 3.1, when I hit the shutter release button the app closes.
I hope someone can tell me if there's something obvious in the code..
Thanks, Chris
The following is the code (which xcode is showing as error)
In 2.2, when I hit the shutter release button, after a moment an image is saved to the photo library. In 3.1, when I hit the shutter release button the app closes.
I hope someone can tell me if there's something obvious in the code..
Thanks, Chris
The following is the code (which xcode is showing as error)
Code:
- (UIImage*)correctImageOrientation:(CGImageRef)imag e {
CGImageRef img = UIGetScreenImage();
UIImage* scImage=[UIImage imageWithCGImage:img];
CFRelease(img);
return scImage;
//UIImage imageWithCGImage:UIGetScreenImage();
}
- (BOOL)grabPictureFromImageView:(UIView*)view {
CGImageRef img = (CGImageRef)[view imageRef];
if (img)
{
// Taken image is in UIImageOrientationRight orientation
UIImage *photo = [self correctImageOrientation:img]; // get the captuered image in the photo with correct orientation
//UIImageWriteToSavedPhotosAlbum(photo, nil, nil, nil);
UIImageWriteToSavedPhotosAlbum(photo, self, @selector(imageSavedToPhotosAlbum:didFinishSavingW ithError:contextInfo:), nil); //save the image in the album
[imageCopy release]; imageCopy = nil;
return YES;
}
return NO;
}