을 입력 할 때 호출되지 않습니다. 내 목표는 앱이 전면을 입력 할 때마다 내 위치 정보를 가져 와서 내 일기 예보를 업데이트합니다. 내가 뭘하는 그러나didUpdateLocations는 앱이 전경, 코어 위치, ios
- (void)viewDidLoad
{
[super viewDidLoad];
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
self.locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
}
- (void)viewWillAppear:(BOOL)animated
{
self.locationManager.delegate = self;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
}
#pragma mark - Click to get weather
-(void)enterForeground {
[self.locationManager startUpdatingLocation];
}
#pragma mark - CLLocationManagerDelegate
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
[email protected]"didUpdateLocations";
}
, enterForeGround
입니다 않습니다 내가 땅 이물 입력하지만 didUpdateLocations은 항상 전화를받을 doesnot whenver 전화를받을. 위치 서비스를 위해 중요한 몇 가지 사항을 놓치고 있는지 알지 못합니다. 아이디어가 있으면 조언 해주세요. 감사합니다.