【发布时间】:2011-07-24 13:02:35
【问题描述】:
我想为我的应用程序添加一个“摇动设备”事件 - 即,当用户摇动设备时,会发生一些事情。 我尝试实施:
-(void) motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
if (event.subtype == UIEventSubtypeMotionShake) {
//something happens
}
}
它似乎不起作用.......
有谁知道我应该使用哪种方法?
【问题讨论】: