0
我需要在应用程序调用的背景中运行一个计时器,然后才能进入背景方法。我遇到了一些麻烦。当我进入背景时,它什么都不做。这是我的代码。是否有可能在后台运行计时器?
- (void)applicationDidEnterBackground:(UIApplication *)application {
bcheckingTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(bchecker) userInfo:nil repeats:YES];
}
- (void)bchecker {
NSLog(@"Switch is on, will annoy");
}