0
-(void) closeUpShopBeforeBackgrounding {

    // this listen to the UIApplicationDidEnterBackgroundNotification  

    [self beginBackgroundUpdateTask];
        // do some closing stuff
    [self endBackgroundUpdateTask]; }

- (void) beginBackgroundUpdateTask {
    self.backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
        [self endBackgroundUpdateTask];
    }]; }

- (void) endBackgroundUpdateTask {
    [[UIApplication sharedApplication] endBackgroundTask: self.backgroundTask];
    self.backgroundTask = UIBackgroundTaskInvalid; }

This code is working fine for me, but when I foreground the app again, its dead in the water. Its as if the viewDidLoads are not firing, and nothing is happening.

Is there anything I need to do when the app foregrounds to kick it back into life?

4

0 に答える 0