私はこれをテストするためにシミュレータとデバイスの両方を使用していますが、私が何をしてもdidUpdateToLocationは呼び出されません。私はシム内の自分の位置を変更しようとしましたが、携帯電話の新しいロケーションサービスをオフにしてからオンにして、電話機に新しいロケーションを検索させるように強制しました...何もありません。didUpdateToLocationが呼び出されなかった
CLLocationManager *manager = [[CLLocationManager alloc] init];
if (![CLLocationManager locationServicesEnabled])
{
UIAlertView *servicesDisabledAlert = [[UIAlertView alloc] initWithTitle:@"Location Services Disabled" message:@"You currently have all location services for this device disabled. If you proceed, you will be asked to confirm whether location services should be reenabled." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[servicesDisabledAlert show];
} else {
manager.desiredAccuracy = kCLLocationAccuracyBest;
manager.delegate = self;
[manager startUpdatingLocation];
}
をし、位置更新方法で私はこれがあります:私のviewDidLoad()で、私はそうとCLLocationManagerを開始している
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"NEW LOCATION! Accuracy:[%f]",newLocation.horizontalAccuracy);
}
誰もこれが呼び出されていない理由を任意のアイデアを持っています?
どのように私はそれを逃したのですか?ありがとう。 –
私は助けることができてうれしいです... – AAV