Quantcast
Viewing latest article 1
Browse Latest Browse All 4

Answer by Tom Harrington for Recreating core data at application launch

It depends on how critical it is that data on the device always be current, on how long you expect users to wait before working with the app, and on what you want to happen if someone tries to use the app when the network is slow or unavailable. If you delete the store, and the app can't connect immediately, the user has no data. Even if the network is fine, the user still has to wait on network and server latency before they can start using the app. This is likely to be poor UX.

On the other hand if you allow data to persist after the app exits, the user's data might not be current, at least not at first.

If you don't ever want the data to persist after the app exits, an in-memory store might be the best choice, because it will never be saved to a file anyway.

If presenting potentially old data is OK either (a) briefly when the app starts up or (b) when the network is unavailable, a better choice would be to keep the data store but make new network calls to update the existing data. You could provide some sort of UI to indicate that updates are in progress. You might also have some in-app indication of when your app last synced with the server.


Viewing latest article 1
Browse Latest Browse All 4

Trending Articles