我已經編寫這個程序來保存圖像,同時採摘的UIImage,但我需要的代碼 保存UIImagePickerControllerSourceTypePhotoLibrary圖像,而只能通過相機捕捉
圖像。保存拍攝的圖像在照片庫中
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
if([info objectForKey:@"UIImagePickerControllerOriginalImage"])
{
NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
if ([mediaType isEqualToString:(NSString *)kUTTypeImage])
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
UIImageWriteToSavedPhotosAlbum(image,nil,nil,nil);
PhotoViewController *photoVC=[[PhotoViewController alloc]initWithNibName:@"PhotoViewController" bundle:nil];
photoVC.photoImage=image;
photoVC.photoDelegate=self;
[self.navigationController pushViewController:photoVC animated:YES];
}
}