void UIImageWriteToSavedPhotosAlbum(UIImage *image,id completionTarget, SEL completionSelector, void *contextInfo);
image:要保存到照片库的图片对象,UIImage类型
completionTarget:当保存完成之后,回调方法所在的对象
completionSelector:回调方法
contextInfo:可选的参数,保存一个指向context数据的指针,它将传递给回调方法
回调方法可以这样定义:
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
if(error == nil){
//show error message
}else{
//save successfully
}
}