Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
UIImagePickerController不请求iOS 9上的权限_Ios_Objective C_Permissions_Uiimagepickercontroller_Ios Permissions - Fatal编程技术网

UIImagePickerController不请求iOS 9上的权限

UIImagePickerController不请求iOS 9上的权限,ios,objective-c,permissions,uiimagepickercontroller,ios-permissions,Ios,Objective C,Permissions,Uiimagepickercontroller,Ios Permissions,我有一个iOS应用程序,其中我提供了一个图像选择器 self.picker = [[UIImagePickerController alloc] init]; self.picker.delegate = self; self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.popover = [[UIPopoverController alloc] initWithContentViewContr

我有一个iOS应用程序,其中我提供了一个图像选择器

self.picker = [[UIImagePickerController alloc] init];
self.picker.delegate = self;
self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

self.popover = [[UIPopoverController alloc] initWithContentViewController:self.picker];
[self.popover presentPopoverFromRect:CGRectMake(100, 100, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
但是,该应用程序根本不请求权限,它只显示错误消息“此应用程序无法访问您的照片或视频”

你知道是什么原因造成的吗


提前谢谢

在iOS 9中,UIPopoverController已被弃用,为什么不改用presentViewController。

问题在于信息中未设置捆绑包显示名称。plist

访问先前已被拒绝?不,我删除了该应用,重置了隐私设置,问题仍然存在。什么版本的iOS?似乎只有iOS 9。我也尝试过这样做:但我也遇到了同样的问题您可以尝试使用全屏样式,而不是popover,我不确定您为什么要使用popover。如果我使用全屏,我只会得到一个黑屏。这段代码似乎仅在iOS 9上的iPad上不起作用。在其他设备和版本上,它可以工作。请尝试检查[AlassetLibrary authorizationStatus]并检查结果值,同时尝试在info中添加NSPhotoLibraryUsageDescription key。PlistalAssetLibrary似乎也被弃用,我甚至收到一个未声明的标识符错误。为了安全起见,我的info.plist.中已经有NSPhotoLibraryUsageDescription。。。我们可以在info.plist中添加隐私-照片库使用说明