PHPhotoLibrary 获取相册权限注意事项
获取权限的回调用完就释放
requestAuthorization 中的回调使用完就释放了,不会造成内存泄漏,反而是如果使用了weak回造成提前释放
所以,在该block中,不需要使用weak 引用
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusRestricted || status == PHAuthorizationStatusDenied) {
}else{
dispatch_async(dispatch_get_main_queue(), ^{
UIImageWriteToSavedPhotosAlbum(weakSelf.showImage, weakSelf, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
});
}
}];