Motion events do not use the UIAccelerometer delegate. The system determines motion events such as shake (by querying the accelerometer itself) and then sends the messages to the firstResponder application.
Detecting Shake In Code
Shake Start
//********** MOTION BEGAN **********
- (void)motionBegan:(UIEventSubtype)motion
withEvent:(UIEvent *)event
{
if (motion == UIEventSubtypeMotionShake)
{
NSLog(@"shake started");
}
}
//If necessary add to viewWillAppear:
[[self view] becomeFirstResponder]; //Make this view the first responder
Shake Stop
//********** MOTION ENDED **********
- (void)motionEnded:(UIEventSubtype)motion
withEvent:(UIEvent *)event
{
}
//********** MOTION CANCELLED **********
//(Triggered when a shake is interrupted (e.g. by an incoming call)
- (void)motionCancelled:(UIEventSubtype)motion
withEvent:(UIEvent *)event
{
}