1

I'm creating an app that should download a big number of JSON file and for the first start, I'm thinking to insert these file inside app folder. In this way when users download app, it's not necessary download at first time these file and I can populate the DB offline. Then, (some hours for example), this app download new files (in background download, parse and update the DB) and it has all data updated. This is perfect, but it has a BIG problem: If user delete app and download it another time (after a week for example), he can view old data; what can be the solution for this "problem"?

thanks

cyclingIsBetter
  • 17,447
  • 50
  • 156
  • 241

2 Answers2

2

iOS application is able to write data only to it's folder. And this folder will be completely deleted together with application. So there is no reason to worry about old data.

UPDATE: App folder is completely deleted. But old data could be synchronized with iCloud in case if User switched-on this function. To avoid this you should mark your data as forbidden to synchronization. You can find solution here Prevent iCloud sync of data (using .nosync?)

Community
  • 1
  • 1
Avt
  • 16,927
  • 4
  • 52
  • 72
0

It's not a problem - if a user installs your app in 2 months from now, he also will have the "old" data until any updated data is gotten from the web. If the data you want to deliver with your app has no value a few weeks from now, why bother preloading it at all?

You should try loading the updated data from the web as soon as possible to make sure the data the user sees is the most recent one.

By the way, you can also deliver a preloaded database with your app - you don't have to use a JSON file to fill an empty database at first start.

TheEye
  • 9,280
  • 2
  • 42
  • 58
  • mmm ok, then you suggest to don't store data at the beginning... and download all data as soon as possible...ok – cyclingIsBetter Feb 19 '14 at 22:11
  • It depends: if it makes sense to have some data at the beginning - let's say some welcome text - which also is useful in 2 months, and the initial load takes hours, then preload it. If the data is more or less useless in the future and the user needs the current data, then don't bother with a preload. – TheEye Feb 19 '14 at 22:14