Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)applicationDidEnterBackground:(UIApplication *)application {
- [NSTimer scheduledTimerWithTimeInterval:(5.0/5.0) target:self selector:@selector(check_expiry) userInfo:nil repeats:YES];
- }
- - (void)applicationDidEnterBackground:(UIApplication *)application {
- counter = YES;
- while (counter) {
- sleep(5);
- [self check_expiry];
- }
- // Counter is set to NO in willEnterForeground and didBecomeActive, but this loop continues to run due the sleep();
- }
Add Comment
Please, Sign In to add comment