I am using the UIAccelerotmeterDelegate method accelerometer:didAccelerate: but recently that method has been deprecated in iOS 5.0. So what is the alternative way to get the accelerometer data? The documentation does not mention the alternative we are supposed to use.
I am using the UIAccelerotmeterDelegate method accelerometer:didAccelerate: but recently that method has been deprecated
Share
You should use the Core Motion framework (introduced in iOS 4.0) as a substitue. Create an instance of
CMMotionManagerand tell it tostartAccelerometerUpdatesToQueue:withHandler:, passing it anNSOperationQueueand a block that will be executed on the specified queue whenever new accelerometer data is available.