2012-02-22 20 views
0

對於UILocalNotification repeatInterval,NSWeekCalendarUnit和NSWeekDayCalendarUnit有什麼區別?對於UILocalNotification,NSWeekCalendarUnit和NSWeekDayCalendarUnit的區別repeatInterva

localNotification = [[UILocalNotification alloc]init]; 
NSDate *currDate1 = [defaults objectForKey:@"Default_AlarmTime"]; 
localNotification.fireDate = currDate1; 
localNotification.alertBody = @"Alarm"; 
localNotification.alertAction = @"View"; 
localNotification.soundName = UILocalNotificationDefaultSoundName; 
localNotification.timeZone = [NSTimeZone defaultTimeZone]; 
localNotification.repeatInterval = NSWeekdayCalendarUnit; 
[[UIApplication sharedApplication]scheduleLocalNotification:localNotification]; 

本地通知被觸發多少次?

回答

0

如果您爲repeatInterval屬性設置了NSWeekdayCalendarUnit,那麼它將每天調用。

如果您爲重複間隔屬性設置NSWeekCalendarUnit,那麼它將每週調用一次。

相關問題