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 upIn iOS 5.0.1 and later, put support files in the <Application_Home>
/Library/Application Support
directory and apply thecom.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.
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设置-安全设置-本地策略-安 ...
随机推荐
- java环境变量配置问题
你要配置三个环境变量JAVA_HOMECLASSPATHPath你都配置了吗? 系统变量→新建 JAVA_HOME 变量 .变量值填写jdk的安装目录(本人是 E:\Java\jdk1.7.0) 系统 ...
- 普通图片转ascii码字符图
效果图 基本思路 把图片每个像素点的信息拿出来,最重要的是拿到rgb的值 把每个像素点由rgb转成灰度图像,即0-255 给0-255分级,把每个等级的像素点转换成ascii码,完成 实现 第一步:获 ...
- perl 处理perl返回的json
[root@wx03 ~]# cat a14.pl use Net::SMTP; use LWP::UserAgent; use HTTP::Cookies; use HTTP::Headers; u ...
- perl学习(10) 字符串处理函数和排序
1.1.index Perl 查找子串第一次在大字符串中出现的地方,返回第一个字符的位置. . . my $stuff = “Howordy world!”; my $where3 = index($ ...
- [linux]linux命令学习-netstat
linux非常多服务都与网络相关.当服务调不通或者是启动port被占用,或者是又是被防火墙挡住的时候,就须要查询网络相关的问题,netstat命令之前仅仅会用一两个參数这里.好好学习一番. 经常使用的 ...
- 关于Get和Post
get和post 简介: Get和post是表单提交数据的两种基本方式,get请求数据通过域名后缀url传送,用户可见,不安全,post请求数据通过在请求报文正文里传输,相对比较安全. get是通过u ...
- Linux 安装Redis全过程日志
wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make ...
- linux下C/C++IDE比较——Code::Blocks
工欲善其事,必先利其器.用了这么久的linux,现在比较主流的几个C/C++的IDE基本已都用过了,现在来对他们做一下简单的比较. 1.VIM首先要说的是VIM.我认为,VIM只是一个编辑器,不能算是 ...
- 在webx.ml中 配置struts2 后 welcome-file-list 失效的解决办法
struts2 <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.a ...
- oracle表连接------>排序合并连接(Merge Sort Join)
排序合并连接 (Sort Merge Join)是一种两个表在做连接时用排序操作(Sort)和合并操作(Merge)来得到连接结果集的连接方法. 对于排序合并连接的优缺点及适用场景例如以下: a,通常 ...