Search code examples
objective-cnsdatenscalendar

How to implement cache manager in objective c?


I want to implement cache manager,for that I want to clear the cache after 15 days, how to implement this? How will I get to know 15 days completed or not, How I can achieve this any idea?


Solution

  • The broad strokes: Store your desired cache expiration date, set a timer to go off on that date, and check on startup whether you're past the date. If either the timer goes off or the startup check is positive, clear the cache.