単一の場所を取得して、からの通知を停止したいCLLocationManager
。
私はこれでそれを行います:
-(id)initWithDelegate:(id <GPSLocationDelegate>)aDelegate{
self = [super init];
if(self != nil) {
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
delegate = aDelegate;
}
return self;
}
-(void)startUpdating{
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
[locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
[locationManager stopUpdatingLocation];
[delegate locationUpdate:newLocation];
}
問題は、私がそうしても[locationManager stopUpdatingLocation];
の- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:
私はまだ通知を受け取ります。なぜそれが起こるのか分かりますか?