В фоновом режиме ваш код приостановлен, и никакие события таймера вы не получите, пока ваше приложение снова не выйдет на первый план.
Вы должны пойти на запланированные локальные уведомления, чтобы разбудить фон после определенного интервала. Однако он покажет пользователю всплывающее окно или баннер, который он должен принять в первую очередь.
Вот несколько шагов, как это сделать:
// When you want to schedule:
UILocalNotification* localNotification = [[[UILocalNotification alloc] init] autorelease];
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:5]; // seconds
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.alertBody = @"Body text";
localNotification.alertAction = @"Button text";
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
// when it's fired it will call your AppDelegate's didReceiveLocalNotification
- (void)application:(UIApplication *)app didReceiveLocalNotification:(UILocalNotification *)localNotification
{
// you can handle timer event here and eventually re-schedule your local notification
}