What is the best way to buffer incoming events/notifications your iPhone app is observing so as not to trigger event code for each event? A code sample would be great…
e.g. would it be to create an NSMutableArray in the controller to add each event to, and for each event that comes in it triggers a count down time for 2 seconds, so the timer countdown would trigger the events handling code…in which case what would be the best Objective-C classes to use for such a buffer/timer/countdown…
background – in my case it the events from “EKEventStoreChangedNotification” that I handle, but noting there are multiple that can come through for the same single calendar item change (well as far as i can tell)
attach an object to your main run loop (typically via a timer). the object receives, collects, filters, and coalesces the events as needed.
something like this would be a starting point (not compiled):
Now create the timer and add it to the main run loop: