我正在使用位置服务让我的应用程序保持更长时间,它在我的iOS6(设备和模拟器)中工作正常,但在iOS7中它没有调用CLLocationManager
的委托函数,
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
如何在iOS7中完成这项工作?
答案 0 :(得分:6)
此方法在iOS 6.0中已弃用
使用此方法
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
location_updated = [locations lastObject];
NSLog(@"updated coordinate are %@",location_updated);
}
答案 1 :(得分:0)
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
location_updated = [locations lastObject];
NSLog(@"updated coordinate are %@",location_updated);
}