I have one class name as myClassCalculate have the following method
- (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)accel
You can't, only VOIP, audio and navigation apps are allowed to run in background. Thus if your app does not fall in one of these it gets suspended and wil not receive any events.
More about backgrounding: App States and Multitasking
Declaring Your App’s Supported Background Tasks
Support for some types of background execution must be declared in advance by the app that uses them. An app declares support for a service using its Info.plist file. Add the UIBackgroundModes key to your Info.plist file and set its value to an array containing one or more of the following strings:
audio
— The app plays audible content to the user while in the background. (This content includes streaming audio or video content using AirPlay.)
location
— The app keeps users informed of their location, even while it is running in the background.
voip
— The app provides the ability for the user to make phone calls using an Internet connection.
newsstand-content
— The app is a Newsstand app that downloads and processes magazine or newspaper content in the background.
external-accessory
— The app works with a hardware accessory that needs to deliver updates on a regular schedule.