ALAssetsLibrary*library=[[ALAssetsLibraryalloc]init];

[librarywriteImageToSavedPhotosAlbum:p_w_picpath.CGImageorientation:p_w_picpath.p_w_picpathOrientationcompletionBlock:^(NSURL*asSetUrl,NSError*error){

if(error){

UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"保存图片失败"

message:@"请打开设置-隐私-照片来进行设置"

delegate:nil

cancelButtonTitle:@"确定"

otherButtonTitles:nil,nil];

[alertshow];

[alertrelease];

}else{

UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"保存图片成功"

message:nil

delegate:nil

cancelButtonTitle:@"确定"

otherButtonTitles:nil,nil];

[alertshow];

[alertrelease];

}

}];