我有个奇怪的问题。在我的应用程序中,我问设备,DeviceMotion是否可用:
if (coreMotionManager.isDeviceMotionAvailable) {
coreMotionManager.deviceMotionUpdateInterval = 1.0 / 60.0;
[coreMotionManager startDeviceMotionUpdates];
[NSTimer scheduledTimerWithTimeInterval:1.0 / 60.0 target:self selector:@selector(didUpdateCoreMotion) userInfo:nil repeats:YES];
}
else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"NO DEVICE MOTION" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
}但这总是错误的。我做错了什么?我在我的iPad 3上做这件事,过去我已经和CMMotionManager一起玩过了,还有.deviceMotion.attitude.roll,投球和偏航,一切都很好。但现在我总是保持警惕
有人知道什么是不对的吗?非常感谢您的帮助:)
终于重新启动我的Mac帮助了,在重新启动之后,一切都成功了!:)谢谢凯留下来帮助我:)
发布于 2012-12-11 16:23:23
最后,重新启动我的Mac帮助了,在重新启动之后,一切都成功了!:)谢谢凯留下来帮忙:)
发布于 2012-12-10 22:07:54
重置你的IPad。我以前曾在ipad 2和ipad 3上遇到过这种情况,设备只是拒绝给我态度。我猜是因为内部陀螺仪出毛病了,需要重新设置。
https://stackoverflow.com/questions/13809462
复制相似问题