-2
我想在ios應用程序中安排一個本地通知,使其每年在6月28日觸發。我搜索了這個,但無法得到。怎麼做? 謝謝每年在特定日期發出本地通知
我想在ios應用程序中安排一個本地通知,使其每年在6月28日觸發。我搜索了這個,但無法得到。怎麼做? 謝謝每年在特定日期發出本地通知
使用UILocalNotification
你可以做到這一點。
嘗試,
UILocalNotification *notif = [[cls alloc] init];
NSDateFormatter *df=[[NSDateFormatter alloc]init];
[df setDateFormat:@"dd-MM-yyyy"];
notif.fireDate = [df dateFromString:@"28-06-2013"];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = @"You Reminder";
notif.alertAction = @"Show";
notif.soundName = UILocalNotificationDefaultSoundName;
notif.applicationIconBadgeNumber = 1;
notif.repeatInterval=NSYearCalendarUnit;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
如果我想火,每12周,怎麼能做到呢? –