我有一个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];
Run Code Online (Sandbox Code Playgroud)
但该应用程序根本不会要求权限,它只显示错误消息"此应用程序无法访问您的照片或视频".
关于可能导致这种情况的任何想法?
提前致谢!
permissions objective-c uiimagepickercontroller ios ios-permissions
我已经尝试过将CoreLocation与我的Swift应用程序一起使用,但没有运气.我有以下非常简单的代码:
(我已经链接了CoreLocation库.)
import UIKit
import CoreLocation
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate {
var window: UIWindow?
var locationManager: CLLocationManager = CLLocationManager()
locationManager.delegate = self
Run Code Online (Sandbox Code Playgroud)
在最后一行,我收到错误"预期声明".
我究竟做错了什么?
提前致谢!