I am developing an iPhone app (in Objective-C), and I am trying to make it so that there is some sort of ‘action listener’ that is constantly checking to see if the current date and time match that of the first object in a NSMutableArray filled with event objects (retrieved from the users calendar).
My problem is that I cannot figure out how to do so, while the rest of my code continues to run, because right now I have a for loop running to constantly check, which stops my code, and prevents the app from continuing to run. If anyone knows any sort of tutorials, or has an explanation, I would greatly appreciate it.
Thanks!
Setup a NSTimer to fire at the desired date.
This NSTimer category here is useful for this purpose: https://github.com/adamjernst/NSTimer-AbsoluteFireDate
You can also try to create and schedule a UILocalNotification to get notified at a specific date.