标签:
注:使用 UIImageWriteToSavedPhotosAlbum 保存图像, UISaveVideoAtPathToSavedPhotosAlbum 保存视频. 4.0后使用 writeImageToSavedPhotosAlbum:metadata:completionBlock: 保存元数据.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSString* path = [[info objectForKey:UIImagePickerControllerMediaURL] path];
// 保存视频
UISaveVideoAtPathToSavedPhotosAlbum(path, self, @selector(video:didFinishSavingWithError:contextInfo:), nil);
[self dismissModalViewControllerAnimated:YES];
}
// 视频保存回调
- (void)video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo: (void *)contextInfo {
NSLog(@"%@",videoPath);
NSLog(@"%@",error);
}
标签:
原文地址:http://www.cnblogs.com/yan-chao-zhi/p/5256993.html