UILocalNotification is scheduleLocalNotification a little late?

After the call scheduleLocalNotification:

in the singleton, UIApplication

I sometimes notice that the array of notifications returned scheduledLocalNotifications

in the singlet UIApplication

does not actually include the just scheduled notification.

This has not been a problem until now, or not, which I know about. We used the assumption that local notifications are available immediately after they are scheduled.

Should we assume that the scheduling of local notifications happens in some background OS thread, and not expect them to be visible immediately after the schedule?

As I am updating my interface, depending on whether there is this notification or not ...

Can anyone find an official word on this? I have not found any discussions.

+3


source to share


1 answer


From the docs: scheduleLocalNotification: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/#//apple_ref/occ/instp/UIApplication/scheduledLocalNotifications

This method can be faster than scheduling a large amount of notification.



scheduledLocalNotifications

can be assigned directly, and the docs say it could be faster than scheduleLocalNotification:

. I understand that the later method may be slow.

You should just try to use scheduledLocalNotifications

directly.

0


source







All Articles