Aplicativo de aplicativo para iOSWillEnterForeground e ficou preso por um tempo
Eu adiciono essa função para postar uma notificação quando o aplicativo entrar em primeiro plano:
- (void)applicationWillEnterForeground:(UIApplication *)application
{
[[NSNotificationCenter defaultCenter] postNotificationName: @"UIApplicationWillEnterForegroundNotification" object: nil];
}
Na minha própria aula:
- (void) handleEnterForeground: (NSNotification*) sender
{
[self reloadTableData];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(handleEnterForeground:)
name: @"UIApplicationWillEnterForegroundNotification"
object: nil];
}
mas a função handleEnterForeground: será chamada duas vezes, não sei por quê. A função reloadTableData: chamará webService remoto, portanto, quando o aplicativo entrar em primeiro plano, ele ficará preso por algum tempo.