位置经理代表没有被调用

KSR*_*KSR 1 iphone cllocationmanager ios6 ios7

我正在使用位置服务让我的应用程序保持更长时间,它在iOS6(设备和模拟器)中工作正常,但在iOS7中它没有调用此委托函数CLLocationManager,

-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
Run Code Online (Sandbox Code Playgroud)

如何在iOS7中完成这项工作?

mor*_*oko 6

此方法在iOS 6.0中已弃用

使用此方法

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations

{
location_updated = [locations lastObject];    
NSLog(@"updated coordinate are %@",location_updated);

}
Run Code Online (Sandbox Code Playgroud)