I have one class name as myClassCalculate have the following method
- (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)accel
At WWDC this year they said that accelerometer updates could be observed in the background but I'm not sure how to do it. I think it would be iOS 5 only.
To do background tasks you need to add them to your info.plist in the UIBackgroundModes key. Here is what's available right now.
audio The application plays audible content in the background.
location The application provides location-based information to the user and requires the use of the standard location services (as opposed to the significant change location service) to implement this feature.
voip The application provides Voice-over-IP services. Applications with this key are automatically launched after system boot so that the application can reestablish VoIP services. Applications with this key are also allowed to play background audio.
newsstand-content The application processes content that was recently downloaded in the background using the Newsstand Kit framework, so that the content is ready when the user wants it. This value is supported in iOS 5.0 and later.
external-accessory The application communicates with an accessory that delivers data at regular intervals.
Try putting location in the plist or using [UIApplication beginBackgroundTaskWithHandler:] This value is supported in iOS 5.0 and later.