UIImagePickerController not asking for permissions on iOS 9

北城以北 提交于 2019-12-22 05:20:56

问题


I have an iOS app where I present an image picker the

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];

The app however doesn't ask for permissions at all, it just displays the error message "This app does not have access to your photos or videos".

Any ideas on what might cause this?

Thanks in advance!


回答1:


The issue was the the Bundle Display Name wasn't set in the Info.plist




回答2:


in iOS 9, UIPopoverController is deprecated and why don't you use presentViewController instead.



来源:https://stackoverflow.com/questions/33009290/uiimagepickercontroller-not-asking-for-permissions-on-ios-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!