Use of background/foreground methods in AppDelegate

Each object receive a UIApplicationDidEnterBackgroundNotification notification when the app goes in background. So to run some code when the app goes in background, you just have to listen to that notification where you want : [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appHasGoneInBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; Don’t forget to release the listener when you don’t need to listen to it … Read more