We need to download the data again when we recover the wake-up app. Of course we all know that waking up the app is called
Appdelegate under the Applicationdidbecomeactive this method
1 #pragmaMark--Recovery2 3 //Recovery4 5- (void) Applicationdidbecomeactive: (UIApplication *) Application {6 7NSLog (@"Recovery ====================================");8 9 //whether to download the common data background ++++++++++++++++++++++++++++++++++++++++++++++++++++ after comparing the last pending storage timeTen One A - - the}View Code
This method is called to call and so on. If we simply press the big button to wake up the recommended
Applicationwillenterforeground This method
We can write it in the viewdidload in the desired picture.
1 // wake-up Notification listener 2 3 [[Nsnotificationcenter Defaultcenter] addobserver:self selector: @selector (applicationwillenterforeground:) Name: Uiapplicationwillenterforegroundnotification Object: nil];
View Code
In this screen to write the following can be
1 // -wake-up notification monitoring 2 #pragma mark-Wake Notification Listener 3 -(void) Applicationwillenterforeground: (Nsnotification *) Notification {4 // Refresh ...
wake-up Notification listener
Resume Wakeup app call load.