【发布时间】:2013-07-30 20:46:00
【问题描述】:
我有以下代码:
- (void) viewWillAppear {
[self startSignificantChangeUpdates];
}
- (void)startSignificantChangeUpdates
{
if ([CLLocationManager locationServicesEnabled])
{
NSLog(@"start significant changes");
if (nil == locationManager)
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
[locationManager startMonitoringSignificantLocationChanges];
}
}
problem is that the location manage is not calling its delegate function
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
我能做什么?
【问题讨论】:
-
它可能无法解决您的问题,但我建议使用
didUpdateLocations:而不是didUpdateToLocation:fromLocation(请参阅 stackoverflow.com/questions/12602463/…),因为 Apple 已弃用它。
标签: ios cllocationmanager cllocation