I have one class name as myClassCalculate have the following method
- (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
NSLog(@"Accelerometer is called");
}
I am making object in
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
myObject = [[myClassCalculate alloc] init];
now when app will go in background, I want this
- (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
What can I do, so that this method will get called in app background
Thanks
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