-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{
if(motion==UIEventSubtypeMotionShake)
{
代码A
}
}
-(BOOL)canBecomeFirstResponder{
return YES;
}
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self becomeFirstResponder];
}
-(void)viewWillDisappear:(BOOL)animated
{
[self resignFirstResponder];
[super viewWillDisappear:animated];
}
第一次摇动的时候有相应,会执行到代码A;但是再摇就不管用了,请问为什么?