Ios 无法使用照片库上载图像

Ios 无法使用照片库上载图像,ios,objective-c,image,gallery,Ios,Objective C,Image,Gallery,在ios应用程序中从gallery中选择图像后,我收到此错误 发现扩展时遇到错误:错误域=PlugInKit代码=13“查询已取消”UserInfo={NSLocalizedDescription=query cancelled} 我还添加了-隐私-照片库照片描述,相机描述 还尝试了-操作系统活动模式禁用 但是仍然无法修复我不确定您使用的是什么代码,但问题之一可能是您没有正确处理所有授权案例 func performPermissionCheck() { let authorisatio

在ios应用程序中从gallery中选择图像后,我收到此错误 发现扩展时遇到错误:错误域=PlugInKit代码=13“查询已取消”UserInfo={NSLocalizedDescription=query cancelled}

我还添加了-隐私-照片库照片描述,相机描述

还尝试了-操作系统活动模式禁用


但是仍然无法修复

我不确定您使用的是什么代码,但问题之一可能是您没有正确处理所有授权案例

func performPermissionCheck() {
    let authorisationStatus = PHPhotoLibrary.authorizationStatus() 

    switch authorisationStatus {
        case .authorized: 
             print("Access granted")
        case .notDetermined: 
             PHPhotoLibrary.requestAuthorization({ newStatus in 
              if newStatus == PHAuthorizationStatus.authorized { 
                  print("success")}
            })
        case .restricted: 
             print("No access to album")
        case .denied: 
             print("Permission Denied")
   }
}

询问问题时需要代码,同时添加修复问题的尝试-(void)选择Image{UIImagePickerController*picker=[[UIImagePickerController alloc]init];picker.delegate=self;picker.allowsEditing=YES;picker.sourceType=UIImagePickerController源类型PhotoLibrary;[self-presentViewController:picker animated:YES completion:NULL];}//从gallery上载图像,但在选择图像并单击“选择”后,出现上述错误我发现: