小编Dha*_*tel的帖子

如何在ios 8中获取当前位置lat?

我的问题是在ios 8中没有得到当前位置的纬度和经度.我试图在ios 8的.plist文件中设置密钥,但是没有调用这个方法 - didUpdateToLocation:请帮助解决这个问题.

我的代码是: -

- (void)viewDidLoad
Run Code Online (Sandbox Code Playgroud)

{

[super viewDidLoad];
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;

if(IS_OS_8_OR_LATER) {
    //[self.locationManager requestWhenInUseAuthorization];
    [self.locationManager requestWhenInUseAuthorization];
    [self.locationManager startUpdatingLocation];
}
Run Code Online (Sandbox Code Playgroud)

}

objective-c ios8

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

ios8 ×1

objective-c ×1