当拍摄完毕后,点击USE就保存到本地相册里面,应该在这个方法:-(void)imagePickerController: (UIImagePickerController )picker didFinishPickingMediaWithInfo:(NSDictionary )info里面如何设置?拍摄完毕后并进行选中状态,如何写该方法?
{
[picker dismissModalViewControllerAnimated:YES];
}
[self performSelector:@selector(imagePickerController:didFinishPickingMediaWithInfo:)];
}
[self performSelector:@selector(imageDismiss:) withObject:picker afterDelay:1.0f];
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
// 保存图片
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
[NSThread detachNewThreadSelector: @selector(_saveImage:) toTarget:self withObject:image];
}
}
(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[self performSelector:@selector(imageDismiss:) withObject:picker afterDelay:1.0f];
}
(void)_saveImage:(UIImage* )image{
@autoreleasepool {
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}
}
这个方法是保存图片的方法,我也试过了,可以用。很不错,但是有保存视频的方法吗?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。