私はiPhoneのシミュレータ4.2を使用して表示しようとしていますかNSLog
見出しと他のロケーションサービスの属性。緯度、経度、高度、horizontalAccuracy、VerticalAccuracy、スピード。正しいパラメータとIncase of Headingが実際にイベントを発生させていないことを示しています。 そのようCLLocationコードは、見出しと緯度、経度を表示できるiphoneシミュレータですか?
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
[self.delegate locationUpdate:newLocation];
}
をしてCLHeadingコード
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
[self.delegate headingUpdate:newHeading];
}
を実行していない実行し、私はこれらの両方のコードにブレークポイントを置いたときには、CLHeadingコードには触れないでください。私はinitで位置と見出しを更新しています。
- (id) init{
if (self!=nil) {
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
self.locationManager.distanceFilter = kCLDistanceFilterNone;
[self.locationManager startUpdatingLocation];
[self.locationManager startUpdatingHeading];
}
return self;
}
問題は、シミュレータによるものであるのか、コードに問題があるのかわかりません。
助けてください。
そのシミュレータないあなたのコードを自分のアプリケーションをテストしていません。 – Robin
これは、シミュレータにGPSトラッキングがないため、CLLocationManagerがあなたの場所を取得できないためです。 –