Guest User

Untitled

a guest
Jul 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. - (void)applicationDidEnterBackground:(UIApplication *)application {
  2.  
  3. [NSTimer scheduledTimerWithTimeInterval:(5.0/5.0) target:self selector:@selector(check_expiry) userInfo:nil repeats:YES];
  4.  
  5. }
  6.  
  7. - (void)applicationDidEnterBackground:(UIApplication *)application {
  8. counter = YES;
  9. while (counter) {
  10. sleep(5);
  11. [self check_expiry];
  12. }
  13. // Counter is set to NO in willEnterForeground and didBecomeActive, but this loop continues to run due the sleep();
  14. }
Add Comment
Please, Sign In to add comment