【发布时间】:2013-04-10 11:56:45
【问题描述】:
我无法在我的 Cocos2D 游戏中停止 Gyro 更新,
我的 init 中有以下代码:` //gyro motionManager = [[CMMotionManager alloc] init]; 参考态度=无;
[motionManager startGyroUpdates];
timer = [NSTimer scheduledTimerWithTimeInterval:0.2
target:self
selector:@selector(doGyroUpdate)
userInfo:nil
repeats:YES];
然后在陀螺仪更新本身中,我检查进度何时超过 100% if (progress > 100) {
[self pauseSchedulerAndActions];
[self stopGyroUpdates];
然后:
- (void)stopGyroUpdates{
NSLog(@"Stop gyro update");
}
但它一直在检查...所以 if 语句中的代码不断被调用。
【问题讨论】:
标签: ios xcode cocos2d-iphone core-motion