Hi everyone,
I have been having a play around recently with an app I've been writing, and I want to implement a feature that needs repeating dates. By this I mean you can set a date and an interval, and at those intervals an event happens. And example of what I mean is in the application Cha-Ching:
I have looked at the documentation for NSCalendarDate and NSCalendar, but can't see an easy way of achieving this. All I can think of is to have an object which stores an initial date, an interval value, and the date when an event was last raised. NSCalendarDate's years:months:days:hours:minutes:seconds:sinceDate: method could be used with todays date to see if the last time an event was raised falls inside or outside the specified time interval. If today is outside the interval, then an event can be triggered.
This seems like a pretty long winded solution; does anyone have any pointers that may help?
I have been having a play around recently with an app I've been writing, and I want to implement a feature that needs repeating dates. By this I mean you can set a date and an interval, and at those intervals an event happens. And example of what I mean is in the application Cha-Ching:
I have looked at the documentation for NSCalendarDate and NSCalendar, but can't see an easy way of achieving this. All I can think of is to have an object which stores an initial date, an interval value, and the date when an event was last raised. NSCalendarDate's years:months:days:hours:minutes:seconds:sinceDate: method could be used with todays date to see if the last time an event was raised falls inside or outside the specified time interval. If today is outside the interval, then an event can be triggered.
This seems like a pretty long winded solution; does anyone have any pointers that may help?