Ios4 可以在后台运行计时器吗?

Ios4 可以在后台运行计时器吗?,ios4,nstimer,multitasking,Ios4,Nstimer,Multitasking,我需要有一个计时器在后台运行,由应用程序调用并输入后台方法。我有点麻烦。当我进入后台时,它什么也不做。这是我的密码 - (void)applicationDidEnterBackground:(UIApplication *)application { bcheckingTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(bchecker) userInfo:nil repeats:

我需要有一个计时器在后台运行,由应用程序调用并输入后台方法。我有点麻烦。当我进入后台时,它什么也不做。这是我的密码

- (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");

}

不。这肯定行不通。当应用程序在后台时,它将被挂起且不运行

您希望使用UILocalNotification类来执行您所说的操作

或者查看关于这些类型的多任务主题的更广泛的讨论