每月重复提醒日期选择器IOS

时间:2012-10-29 09:03:48

标签: iphone ios reminders

我正在开发一个应用程序,允许您设置账单的每月提醒,

我查看过datepicckers API,似乎无法找到如何让它每个月重复一次。 我怎么能做到这一点?

2 个答案:

答案 0 :(得分:1)

答案 1 :(得分:1)

根据您的需要定制代码。有关详细信息,请参阅UILocalNotification Class Reference

     UILocalNotification *localNotification = [[[UILocalNotification alloc] init] autorelease];    
     localNotification.fireDate = date; //The date and time when the system should deliver the notification.     
     localNotification.timeZone = [NSTimeZone defaultTimeZone];
     localNotification.alertBody = alertBody;
     localNotification.alertAction = @"View";
     localNotification.repeatCalendar = [NSCalendar currentCalendar];
     localNotification.repeatInterval = NSMonthCalendarUnit;
     localNotification.soundName = UILocalNotificationDefaultSoundName;        
     localNotification.applicationIconBadgeNumber = 1;    
     [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];