0
+(void) vStartUpdatingLocation
{
while (false);
AssertNonMainThread
[[NSOperationQueue mainQueue]addOperationWithBlock:^{
CLLocationHandler * singleton = [CLLocationHandler singleton];
CLLocationManager * locationManager = singleton.locationManager;
NSAssert(locationManager.delegate==singleton,@"They are meant for each other"); //Assertion here
[locationManager startUpdatingLocation]; //update location
PO(singleton.locationManager);
PO(singleton.locationManager.delegate);
PO(singleton); //verify that locationManager.delegate == singleton
while(false);
}];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
AssertMainThread;//break point here never called
PO(self.locationManager);
PO(manager);
while(false);
[self finishUpdating];
[self updateCurrentPlaceCache:newLocation];
}
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
[self finishUpdating]; //no love here too
}
의견에 대한 대부분의 정보를 넣었습니다.didUpdateToLocation과 didFailOnError가 모두 호출되지 않는 이유는 무엇입니까?
내가 locationManager.delegate 실제로 유형 그러나
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
가 호출되지
CLLocationHandler
의 싱글 톤 객체임을 확인했습니다. 그것은 일하는 것이 었습니다.
굉장합니다. 내가 더 높은 점수를받는다면 나는 투표했을 것입니다. –