我正在使用 Xcode 4.3.2,如何在每天早上 6 点设置此本地通知“dateToFire”?
-(void)notification
{
UILocalNotification *localNotification = [[[UILocalNotification alloc] init] autorelease];
if (!localNotification)
return;
// Current date
NSDate *date = [NSDate date];
NSDate *dateToFire = //Everyday: 6AM;
// Set the fire date/time
[localNotification setFireDate:dateToFire];
[localNotification setTimeZone:[NSTimeZone defaultTimeZone]];
[localNotification setAlertBody:@"Notification" ];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self notification];
}