使用
执行当前位置iOS8中的CLLocationManager
但是当它向用户请求许可时,在用户选择他的选择之前,主线程没有等待。
我试过
if ([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
// [self.locationManager requestAlwaysAuthorization];
dispatch_sync(dispatch_get_main_queue(), ^{
[self.locationManager performSelectorOnMainThread:@selector(requestAlwaysAuthorization) withObject:nil waitUntilDone:YES];
});
}
[self.locationManager performSelectorOnMainThread:@selector(startUpdatingLocation) withObject:nil waitUntilDone:YES];
但是它的阻塞主线......
我怎么能等到用户选择他的选择......?