zoukankan      html  css  js  c++  java
  • iOS文件保存策略

    Where You Should Put Your App’s Files

    To prevent the syncing and backup processes on iOS devices from taking a long time, be selective about where you place files inside your app’s home directory. Apps that store large files can slow down the process of backing up to iTunes or iCloud. These apps can also consume a large amount of a user's available storage, which may encourage the user to delete the app or disable backup of that app's data to iCloud. With this in mind, you should store app data according to the following guidelines:

    • Put user data in the <Application_Home>/Documents/. User data is any data that cannot be recreated by your app, such as user documents and other user-generated content.

    • Handle support files—files your application downloads or generates and can recreate as needed—in one of two ways:

      • In iOS 5.0 and earlier, put support files in the <Application_Home>/Library/Caches directory to prevent them from being backed up

      • In iOS 5.0.1 and later, put support files in the <Application_Home>/Library/Application Support directory and apply the com.apple.MobileBackup extended attribute to them. This attribute prevents the files from being backed up to iTunes or iCloud. If you have a large number of support files, you may store them in a custom subdirectory and apply the extended attribute to just the directory.

    • Put data cache files in the <Application_Home>/Library/Caches directory. Examples of files you should put in this directory include (but are not limited to) database cache files and downloadable content, such as that used by magazine, newspaper, and map apps. Your app should be able to gracefully handle situations where cached data is deleted by the system to free up disk space.

    • Put temporary data in the <Application_Home>/tmp directory. Temporary data comprises any data that you do not need to persist for an extended period of time. Remember to delete those files when you are done with them so that they do not continue to consume space on the user’s device.

  • 相关阅读:
    android 底部菜单栏实现(转)
    android 用webView作为编辑器 各种问题
    android 自定图库(转)
    js document.queryCommandState() 各个参数
    自定义简单的按钮点击动画效果
    android 类似QQ底部输入框弹出键盘和面板冲突 布局闪动处理方案(转)
    android 自定义控件View在Activity中使用findByViewId得到结果为null
    Tinker 热修复框架 简单上手教程
    网页天气模块,包括当天天气和未来四天预报
    关于闭包(closure)的一些概念
  • 原文地址:https://www.cnblogs.com/riskyer/p/3280018.html
Copyright © 2011-2022 走看看