I use CoreData and I am thinking about when I should delete waste (or expired) data.
From what I can imagine the points are as follows:
- When the app launches.
- When the app terminates. (in the app delegate's
applicationWillTerminate:
)
One is no-risk, I guess, but I don't want users to wait during the purging. (I know the watch dog exception. If the purge time is over 20 seconds, I will prepare a view controller for waiting.)
Two looks nice. The users don't see the waiting time. However, I'm not sure whether this point is suitable or not? Some people say that background process has limited time.