Right place to store the application data in IOS

后端 未结 3 1007
生来不讨喜
生来不讨喜 2021-01-15 00:58

Currently i was saving my application data (Media) to the CacheDirectory i.e

/var/mobile/Applications/BEAFC76C-C450-4A3A-9765-A0385A9580F3/Li

3条回答
  •  半阙折子戏
    2021-01-15 01:38

    Starting iOS 5, Apple says that it's no longer a good thing to save all kind of files in Documents Directory - if you do that, your app will be rejected for sure because this folder is backed up to iTunes & iCloud, unless otherwise specified.

    It says that we should save files into Caches or Tmp Directory - these won't be backed up, but it's not a good thing to do because files from these directories can disappear if low memory happens.

    So I think the best think to do is to save the important files that you need all the time in your app into Documents Directory and mark them not to be backed up, like this.

提交回复
热议问题