[英]How to grab the NEXT fire date from a UILocalNotification object
[英]next fire date in UIlocalNotification
大家好
我在打印时创建了UILocalNotification ....&
NSLog(@"Notification %@",self.notification)
它给
Notification <UIConcreteLocalNotification: 0x6f45440>
{fire date = 2010-10-22 00:09:00 -0700, time zone = America/Vancouver (PDT) offset -25200
(Daylight), repeat interval = 64, **next fire date** = 2010-10-22 00:10:00 -0700}
但是我想访问该通知的下一个触发日期,我如何获得该值?
请为此提供任何帮助。
UILocalNotification
具有您可以使用的fireDate属性。
只需使用:
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *comps = [calendar components:self.localNotification.repeatInterval
fromDate:self.localNotification.fireDate];
NSDate *nextFireDate = [calendar dateFromComponents:comps];
您可以从[self.notification description](即nsstring)中访问下一个日期,并从返回的字符串中删除不需要的字符
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.