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;
}
는 그들은 시작하고 있습니다. 내 문제는 이제 멀티 태스킹입니다. 배경으로 문제가 생겨 다시 전경으로 가져 오면 [CMMotionManager retain]
메시지가 할당 해제 된 인스턴스로 전송되고 있다는 메시지가 나타납니다 (NSZombie
활성화).
내 문제는 어디에 있습니까?
감사합니다.
그것은 나를 위해 절대적으로 효과가 있습니다! 나는 같은 문제가있다. 오늘 나를 위해 고칠 많은 시간을 낭비한다. 정말 고맙습니다! : D – Sakares
당신은 대단히 환영합니다. 늦은 응답에 대한 죄송합니다 :) – Q8i