*我的视图处于景观模式,我正在保存图像,我想要返回该图像,因为我的代码在下面,我收到错误“由于未捕获的异常‘UIApplicationInvalidInterfaceOrientation’而终止应用程序,原因:‘支持的方向没有共同的方向使用应用程序,并且 shouldAutorotate 返回 YES'" *我可以为 iphone 做什么?
`- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[self dismissModalViewControllerAnimated:YES];
[picker release];
}
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:NO];
imageDoodle.image = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
}
-(IBAction)loadfromalbumclicked:(id)sender
{
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing=NO;
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
// self.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:picker animated:YES];
}
-(IBAction)savePrint{
//Save image to iOS Photo Library
UIImageWriteToSavedPhotosAlbum(imageDoodle.image, nil, nil, nil);
//Create message to explain image is saved to Photos app library
UIAlertView *savedAlert = [[UIAlertView alloc] initWithTitle:@"Saved"
message:@"Your picture has been saved to the photo library, view it in the
Photos app." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
//Display message alert
[savedAlert show];
}`