This is a protocol method UIApplicationDelegateand can only be implemented with the appropriate classes.
You can configure a notification for other objects in the application from your application delegate using the object NSNotificationCenter:
- (void)applicationDidEnterBackground:(UIApplication *)application {
[[NSNotificationCenter defaultCenter] postNotificationName:@"didEnterBackground" object:self];
}
There is also a notice UIApplicationDidEnterBackgroundNotificationthat you can listen to instead of doing above.
Register the objects that you want to listen to for notification, for example:
[[NSNotificationCenter defaultCenter] addObserver:someObject selector:@selector(someMethod:) name:@"UIApplicationDidEnterBackgroundNotification" object:nil];
source
share