background application for iphone 4
Use UILocalNotifications.
3 notifications (ie. 13:00, 13:20 and 13:40) with repeatinterval:NSHourCalendarUnit..
Edit: Something like this:
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.repeatInterval = NSHourCalendarUnit; //Repeat every hour
localNotif.fireDate = [NSDate date]; //Now
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
localNotif.fireDate = [NSDate dateWithTimeIntervalSinceNow:1200]; //Now + 20 min
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
localNotif.fireDate = [NSDate dateWithTimeIntervalSinceNow:2400]; //Now + 40 min
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];
精彩评论