我想我已经做了所有我应该检测到震动的事情,但motionEnded:withEvent:
从来没有被叫过。(一个问题是我没有UIViewController
- 我的应用程序基于“OpenGL ES App”模板。)
我已添加application.applicationSupportsShakeToEdit = YES;
到我的application:didFinishLaunchingWithOptions:
, 和
- (BOOL)canBecomeFirstResponder { return YES; }
到 EAGLView.m(确实会被调用)和[self becomeFirstResponder];
到initWithCoder:
(并且也尝试过其他各种地方)。
但是调试器从来没有命中
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
我错过了一些步骤吗?我必须有一个控制器吗?
(我在 iPad 模拟器中使用 iOS 3.2。)