0
中的预定通知数组的计划通知列表我使用 [[UIApplication sharedApplication] scheduledLocalNotifications]获得了所有计划通知的列表。比较今天的日期和使用iphone
现在我想要所有火焰阵列与今天的日期进行比较,并给予alertview告诉今天到期的提醒。 我是这样做的,但不知道它是否会正常工作。请改正我对iphone开发的新看法。
NSArray *arrayoflocalnotifications = [[NSArray alloc] initWithArray:[[UIApplication sharedApplication]scheduledLocalNotifications]];
for (UILocalNotification *localnotif in arrayoflocalnotifications)
{
NSLog(@"array of firedate is %@", localnotif);
if ([localnotif.fireDate isEqualToDate:[NSDate date]])
{
NSLog(@"Got a duetoday reminder...");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"AlertView" message:@"Due reminder for today" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
[alert show];
[alert release];
}
}
我试过你的建议,但很困惑,我怎么能显示那些匹配在我的tableview和alertview以及火候。 – Mak13
嗨@疯狂-36我解决它像这样 - 转换今天的日期,并从字符串格式arrayoflocalnotifications和比较,我们可以得到提醒/通知,将触发今天。 – Mak13
好;)保持它 – Sandeep