问:
如果有人能向我解释如何找出重复 UILocalNotification不必解析被解雇 - 描述 通知我会给你一些我辛苦赚来的赏金。
答:最简单的方法:
- (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
NSDateComponents *comps = [[NSCalendar currentCalendar] components:notification.repeatInterval fromDate:notification.fireDate toDate:[NSDate date] options:0];
NSLog(@"Notification #%d", [comps minute] + 1);
}
问:如何获得 “明年火日期” 从description
没有解析?
答:有私人/无证功能这样的:nextFireDateForLastFireDate
- (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
NSLog(@"next: %@", [notification nextFireDateForLastFireDate:[NSDate date]]);
}
问:也许有某种的通知计数?财产或方法?
答:有无证属性:
@property (assign, nonatomic) int totalRepeatCount;
@property (assign, nonatomic) int remainingRepeatCount;
但他们似乎总是有相同的价值:UILocalNotificationInfiniteRepeatCount
。它们都由操作系统管理,因此覆盖此属性或底层实例变量什么也不做。此外,内部没有任何变化从触发到触发的UILocalNotifications,没有办法区分一个UILocalNotification与另一个(除了地址在内存中)。 Next fireDate根据当前时间进行计算。
我不认为这是真的可能,因为所有的信息传递(即使在userInfo字典)之前配置。所以我不认为这是为了这个目的。但我可能是错的,只是谈论我的经验。 – Pochi
我不认为这是可能的。从文档中注意到的一点是,每个重复性通知不是一个不同的通知,它是相同的通知再次重新安排在另一次。 – jhabbott