zoukankan      html  css  js  c++  java
  • iOS14 之后 PHAuthorizationStatusNotDetermined保存图片一直出错

    #import <PhotosUI/PhotosUI.h>

    1. 14需要换新的方法

            @WeakObj(self);
            [[PHPhotoLibrary sharedPhotoLibrary]performChanges:^{
                [PHAssetChangeRequest creationRequestForAssetFromImage:theImage];
            } completionHandler:^(BOOL success, NSError * _Nullable error) {
                dispatch_sync(dispatch_get_main_queue(), ^{
                    @StrongObj(self);
                     if (error != nil){
                     }else{
                     }
                });
            }];            
    

      

    2. 下面方法你在相册权限是PHAuthorizationStatusNotDetermined, 拍照保存一直报错,但是图片还是保存成功的 , 不要使用

     UIImageWriteToSavedPhotosAlbum(theImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
    
    
    ///图片保存成功或失败后的处理
    - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
       if (error != nil){
         }else{
        }  ;
        
    }
    

      

  • 相关阅读:
    Hibernate Validation注解列表
    Java_Shell多线程
    Lua读写文件
    shell导出和导入redis
    大文件读写
    Java_Hbase优化
    控制语句if
    字典(DICT)
    元组Tuple
    Session 会话
  • 原文地址:https://www.cnblogs.com/qingzZ/p/14086277.html
Copyright © 2011-2022 走看看