I have an navigation-based app that I want to use the accelerometer to detect a shake and cause a scroll view to scroll to the next page. I have added accelerometer code to the view controller of my scrollView, and it works great; a shake calls my page change method. But when I unload the scrollViewController from the navigation stack the app crashes.
I set up the accelerometer in the viewDidLoad method of the scrollViewController, and respond to a shake in the accelerometer: didAccelerate: delegate method.
When the scrollViewController gets deallocated, the app crashes.
What am I missing?
Thanks