如何设置UILocatNotification每天上午9点开火

时间:2011-05-21 01:11:50

标签: iphone objective-c ios ios4 iphone-sdk-3.0

我需要设置一个UILocatNotification,每天上午9点开火。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:2)

[formatter setDateFormat:[NSDateFormatter dateFormatFromTemplate:@"yyyy-MM-dd HH:mm:ss" 
                                                         options:0
                                                          locale:nil]];
[formatter setTimeZone:[NSTimeZone localTimeZone]];

notification.fireDate = [formatter dateFromString:@"2010-10-21 09:00:00"];
notification.repeatInterval = NSDayCalendarUnit;