Ios7 多个计划的本地通知

Ios7 多个计划的本地通知,ios7,notifications,uilocalnotification,Ios7,Notifications,Uilocalnotification,我正在尝试制作一个应用程序,如果你每天收到1个本地通知,总共64个。所有通知必须不同。到目前为止,我已经写了两份通知,并将其firedate设置为特定日期。但当我运行应用程序时,第一个通知会出现,另一个通知应该在一天后出现。我怎么才能修好它 #import "AppDelegate.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOpti

我正在尝试制作一个应用程序,如果你每天收到1个本地通知,总共64个。所有通知必须不同。到目前为止,我已经写了两份通知,并将其firedate设置为特定日期。但当我运行应用程序时,第一个通知会出现,另一个通知应该在一天后出现。我怎么才能修好它

#import "AppDelegate.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:    (NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can     occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL     ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

NSCalendar *gregCalender = [[NSCalendar     alloc]initWithCalendarIdentifier:NSGregorianCalendar];

NSDateComponents *dateComponent = [gregCalender components:NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit fromDate:[NSDate date]];

[dateComponent setYear:2013];
[dateComponent setMonth:12];
[dateComponent setHour:20];
[dateComponent setMinute:19];

UIDatePicker *dd = [[UIDatePicker alloc]init];
[dd setDate:[gregCalender dateFromComponents:dateComponent]];

UILocalNotification *notification = [[UILocalNotification alloc]init];
[notification setAlertBody:@"hejsan hoppsan"];
[notification setFireDate:dd.date];
[notification setTimeZone:[NSTimeZone defaultTimeZone]];
[notification setSoundName:@"jingle-bells-sms.mp3"];
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
//-------------------------------------------------------------------------------------------

NSCalendar *gregorianCalender = [[NSCalendar alloc]initWithCalendarIdentifier:NSGregorianCalendar];

NSDateComponents *dateComponent2 = [gregorianCalender components:NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit fromDate:[NSDate date]];

[dateComponent2 setYear:2013];
[dateComponent2 setMonth:12];
[dateComponent2 setHour:20];
[dateComponent2 setMinute:20];

UIDatePicker *dd2 = [[UIDatePicker alloc]init];
[dd2 setDate:[gregorianCalender dateFromComponents:dateComponent2]];

UILocalNotification *notification2 = [[UILocalNotification alloc]init];
[notification2 setAlertBody:@"tjena bena"];
[notification2 setFireDate:dd2.date];
[notification2 setTimeZone:[NSTimeZone defaultTimeZone]];
[notification2 setSoundName:@"jingle-bells-sms.mp3"];
[[UIApplication sharedApplication] scheduleLocalNotification:notification2];



}

“总共64天,每天1次本地通知”是什么意思?很抱歉,我的意思是“总共64天,每天1次本地通知”。您能设置准确的时区而不是默认时区吗?