在 iOS7 上运行以下命令时,我的应用程序崩溃。它在 iOS6 上运行良好
UIImagePickerController *ImagePicker;
@try {
ImagePicker = [[[UIImagePickerController alloc]init]autorelease];
ImagePicker.sourceType= UIImagePickerControllerSourceTypeCamera;
ImagePicker.showsCameraControls = NO;
ImagePicker.toolbarHidden = YES;
ImagePicker.navigationBarHidden= YES;
// ImagePicker.wantsFullScreenLayout = YES;
ImagePicker.cameraViewTransform = CGAffineTransformScale(ImagePicker.cameraViewTransform, CAMERA_TRANSFORM, CAMERA_TRANSFORM);
}
@catch (NSException *exception) {
[ImagePicker release];
ImagePicker = nil;
}
@finally {
if(ImagePicker)
{
[cameralayer addSubview:[ImagePicker view]];
[cameralayer release];
}
}