ApplicationWillEnterForeground never called

Hey, I'm trying multitasking in a simulator (I only have a second-generation iPod and iPad) and I still have problems. My testing methods look like this:

- (void)applicationDidBecomeActive:(UIApplication *)application {
 NSLog(@"Entering %s",__FUNCTION__);

 if (enteredFromBackground) {
  NSLog(@"Entering from Background");
  enteredFromBackground = NO;
 }
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
 NSLog(@"Entering %s",__FUNCTION__);

 enteredFromBackground = YES;
}

Unfortunately, I do not see the NSLog from applicationWillEnterForeground, so I added a line to show me something in applicationDidBecomeActive. All I get is

2010-11-20 15:58:12.796 iBeat[45997:207] Entering -[AppDelegate_Shared applicationDidEnterBackground:]
2010-11-20 15:58:18.160 iBeat[45997:207] Entering -[AppDelegate_Shared applicationDidBecomeActive:]
+3
source share
2 answers

Finally, I found my problem! Since I have a universal application, I have Appdelegate_Shared, Appdelegate_iPhone and Appdelegate_iPad. I had an empty implementation of "applicationWillEnterForeground" in two subclasses, but was not called super!

, Appdelegate_Shared o.O

+5

Source: https://habr.com/ru/post/1775981/


All Articles