我有一个非常简单的应用程序示例,它初始化和更新用户位置。在设备上,它每秒左右成功抛出另一个回调位置,但是在设备(运行 iOS7 的 iPhone)上调用该方法一次,然后神秘地停止......
//Setup Location Manager in ViewDidLoad
locationManager = [[CLLocationManager alloc] init];
[locationManager setDistanceFilter:kCLDistanceFilterNone];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[locationManager setDelegate:self];
[locationManager startUpdatingLocation];
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
NSLog(@"location services not turned on");
}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
NSLog(@"loactions %@", locations);
}
-(void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"new location %f, and old %f", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
}
在 iOS6 中,此应用程序运行良好,并不断更新设备位置......自 iOS7 以来发生了什么变化?