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/Cachesdirectory to prevent them from being backed upIn iOS 5.0.1 and later, put support files in the <Application_Home>
/Library/Application Supportdirectory and apply thecom.apple.MobileBackupextended 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/Cachesdirectory. 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>
/tmpdirectory. 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.
iOS文件保存策略的更多相关文章
- iOS 5的文件存储策略应对
苹果在iOS 5系统时,对app的文件存储提出了新的要求.从它的guildline来看,是推荐开发者尽量把app生成的文件放在Caches目录下的.原文如下: Only user-generated ...
- iOS——文件操作NSFileManager (创建、删除,复制,粘贴)
iOS——文件操作NSFileManager (创建.删除,复制,粘贴) iOS的沙盒机制,应用只能访问自己应用目录下的文件.iOS不像android,没有SD卡概念,不能直接访问图像.视 ...
- IOS文件操作的两种方式:NSFileManager操作和流操作
1.常见的NSFileManager文件方法 -(NSData *)contentsAtPath:path //从一个文件读取数据 -(BOOL)createFileAtPath: path cont ...
- Android进阶:一、日志打印和保存策略
前言: 项目开始没有做好日志统计工作,每次有问题后端都得找前端对接,严重影响工作效率.最近特地在项目中加上日志保存策略,在此分享,供需要的人学习. 一.更详细的日志信息 既然决定自定义一个log,那我 ...
- Android数据保存之文件保存
前言: 上一篇文章写了在Android中利用SharedPreferences保存数据,SharedPreferences在保存数据的时候主要是保存一些应用程序的设置信息或者少量的用户信息,并且是以k ...
- C++ 文件保存
文件保存: #include <sstream>#include <fstream>using namespace std; /*save to path ./record ...
- C++第15周(春)项目2 - 用文件保存的学生名单
课程首页在:http://blog.csdn.net/sxhelijian/article/details/11890759.内有完整教学方案及资源链接 本程序中须要的相关文件.请到http://pa ...
- iOS文件处理类
iOS文件处理类 这是一个用来简化iOS中关于文件操作的一个类,所有方法都为类方法. Source File.h // // File.h // FileManager // // http://ho ...
- IE浏览器下载文件保存时提示:“你没有权限在此位置中保存文件”解决办法
E浏览器下载文件保存时提示 解决办法: 1.Win + R,打开运行命令,输入gpedit.msc,如图所示 2.打开计算机本地组策略编辑器:选择计算机配置-windows设置-安全设置-本地策略-安 ...
随机推荐
- How to install vim on linux
前几日了解到 vim 文本编辑器,据说很强大,使用起来效率很高,今天怀着很好奇的心理,学习了一下vim编辑器的下载安装方法,在此详细介绍一下安装vim编辑器的几种常用方法: 第一种方法就是在 Ubun ...
- 网盘大全, 邮箱大全 good
网盘推荐 115网盘 注册 百度网盘 注册 微云 注册 360云盘 注册 金山快盘 注册 新浪微盘 注册 和彩云 注册 酷盘 注册 OneDrive 外链 BOX 注册 Dropbox 注册 国内网盘 ...
- Linux下安装配置词典GoldenDict
GoldenDict apt-get install goldendict 安装完成以后,需要自己手动加入字典,增加在线翻译网址(例如,有道,金山等),点击 编辑--dictionaries 完 ...
- 深入浅出 消息队列 ActiveMQ(转)
一. 概述与介绍 ActiveMQ 是Apache出品,最流行的.功能强大的即时通讯和集成模式的开源服务器.ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范的 JMS Provide ...
- TangoWalk小组课程与优惠(20131208更新) | TangoWalk 学跳阿根廷探戈舞
TangoWalk小组课程与优惠(20131208更新) | TangoWalk 学跳阿根廷探戈舞 TangoWalk小组课程与优惠(20131208更新) Posted by redsky on 2 ...
- hdu3999The order of a Tree (二叉平衡树(AVL))
Problem Description As we know,the shape of a binary search tree is greatly related to the order of ...
- Server Tomcat v7.0 Server at localhost was unable
在eclipse启动tomcat时遇到超时45秒的问题: Server Tomcat v7.0 Server at localhost was unable to start within 45 se ...
- chrome你这是入侵OSX了么?
今天突然发现安装chrome的应用后,会在Dock中出现如下图标,点击即可启动chrome相关应用,很是方便.
- python中文注释及输出出错
今天开始接触python,中文报错,你懂的,不细说. 网上很多类似的解决方案,有不是很明确,例如:http://blog.csdn.net/chen861201/article/details/770 ...
- 基于visual Studio2013解决C语言竞赛题之1077大数相加
题目 解决代码及点评 /************************************************************************/ /* ...