2
我在我的应用程序中使用CMMotionManager
,所以我可以得到设备的运动信息。我有两种方法:CMMotionManager与多任务
- (void)startDeviceMotion {
motionManager = [[CMMotionManager alloc] init];
motionManager.showsDeviceMovementDisplay = YES;
motionManager.deviceMotionUpdateInterval = 1.0/120.0;
[motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXTrueNorthZVertical];
}
二是:
- (void)stopDeviceMotion {
[motionManager stopDeviceMotionUpdates];
[motionManager release];
motionManager = nil;
}
他们推出时,应用程序启动并当应用程序分别完成。我的问题现在是多任务处理。如果我将问题置于后台,然后再次将其置于前台,则会收到一条消息(NSZombie
已激活),告诉我[CMMotionManager retain]
消息正被发送到释放的实例。
我的问题在哪里?
谢谢!
这绝对适合我!我有同样的问题。今天浪费很多时间为我修理。非常感谢! :D – Sakares 2012-04-29 15:36:49
非常欢迎。抱歉迟了回应 :) – Q8i 2012-05-21 10:05:07