次のコードを使用して、アプリのユーザーの位置情報サービスが変更されたかどうかを確認しています。それらが変更された場合、別のView Controllerを表示する必要があります。アプリが起動するたびに実行し、[CLLocationManager authorizationStatus]
ステータスに基づいてリダイレクトするだけで十分です
私のコードの問題は、場所が更新されるたびにセグエが実行されることです。
助けてくれてありがとう
- (void)locationUpdate:(CLLocation *)location {
//locLabel.text = [location description];
NSLog(@"auth status is %u", [CLLocationManager authorizationStatus]);
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized) {
[self performSegueWithIdentifier: @"SegueOffersGPS" sender: self];
} else {
[self performSegueWithIdentifier: @"SegueOffersNoGPS" sender: self];
}