私はiPad 2の内蔵のコンパスを持っているかどうかを知る必要があり、まだ応答する:ipad 2コンパス?
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
iPhoneが行う正確な方法。私が知るべき相違点は?
誰でも手伝ってもらえますか?私は非常に短い時間のためにiPad上で私の手を持っていただけで、私はこのメソッドのコールバックを取得します。このアプリはiPhone 3GS/4でうまく動作します
ありがとう!
=============
は私のコードは次のようになります。
- (void)accelerometer:(UIAccelerometer *)meter didAccelerate:(UIAcceleration *)acceleration {
switch (currentOrientation) {
case UIDeviceOrientationLandscapeLeft:
self.viewAngle = atan2(acceleration.x, acceleration.z);
break;
case UIDeviceOrientationLandscapeRight:
self.viewAngle = atan2(-acceleration.x, acceleration.z);
break;
case UIDeviceOrientationPortrait:
self.viewAngle = atan2(acceleration.y, acceleration.z);
break;
case UIDeviceOrientationPortraitUpsideDown:
self.viewAngle = atan2(-acceleration.y, acceleration.z);
break;
default:
break;
}
[self updateCurrentCoordinate];
}
しかし、私はGPSReader
元のiPadにはコンパスも付いています。 –