Why is my application not detecting a shake gesture?
<p>I'm trying to enable shake gestures within my application but I'm having a problem. </p>

<p>I have different view controllers, but on one of them (not the main view controller for the application) nothing happens in response to a shake gesture.  What could be the problem? </p>

<p>The relevant code is as follows:</p>

<pre><code>-(BOOL)canBecomeFirstResponder {
    return YES;
}

-(void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [self becomeFirstResponder];
}


-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event

{
    if (event.subtype == UIEventSubtypeMotionShake)
    {


 NSLog (@"SHAKED");

    }
}
</code></pre>
