獲取下一個本地通知集的時間的最佳方式是什麼?獲取下一個iOS本地通知的時間
我知道下面的循環可以用來獲取通知,但這是否總是按時間順序排序,所以我可以得到item [0]的時間,或者它是按照何時添加?那麼如何才能從中得到時間呢?我需要獲取整個日期並設置時間格式,還是有更好的方法?
UIApplication *app = [UIApplication sharedApplication];
NSArray *eventArray = [app scheduledLocalNotifications];
for (int i=0; i<[eventArray count]; i++)
{
UILocalNotification* oneEvent = [eventArray objectAtIndex:i];
//oneEvent is a local notification
//get time of first one
}
非常感謝!
山姆
非常好的解決方案,謝謝 –