【问题标题】:Unable to upload image using photo library无法使用照片库上传图片
【发布时间】:2018-12-14 20:48:00
【问题描述】:

从 ios 应用程序的图库中选择图像后出现此错误 发现扩展时遇到的错误:Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}

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

也尝试过 - OS_ACTIVITY_MODE 禁用

但仍然无法修复

【问题讨论】:

  • 提问时需要代码,同时添加您解决问题的尝试
  • -(void)selectImage { UIImagePickerController *picker = [[UIImagePickerController alloc] init];选择器.delegate = self;选择器.allowsEditing = YES; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentViewController:picker animated:YES completion:NULL]; } //从画廊上传图片,但在选择图片并点击选择后,出现上述错误

标签: ios objective-c image gallery


【解决方案1】:

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

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")
   }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-25
    • 2011-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多