我在 iOS8 中遇到了位置更新的新问题。
在 viewDidAppear
我调用我的位置经理:
//start location updating
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
然而这个空白
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
currentLocation = newLocation;
}
永远不会被调用。
这很奇怪,我很确定当我还在芬兰时它仍然有效(使用我的蜂窝数据)。现在我在巴西旅行(只使用 wifi),我无法让它在这里工作,这很奇怪。我的 wifi 接入点似乎是已知的,所以我很困惑。
有任何想法吗?
最佳答案
问题的答案是关于 iOS8 如何处理位置更新的一些消息。这里有一篇很棒的帖子:
http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/
关于ios - CLLocationManager 通过 wifi 更新位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26700146/