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设置-安全设置-本地策略-安 ...
随机推荐
- nodejs安装不了和npm安装不了的解决方法
http://caibaojian.com/nodejs-roll-back.html
- BZOJ 3585: mex( 离线 + 线段树 )
离线, 询问排序. 先处理出1~i的答案, 这样可以回答左端点为1的询问.完成后就用seq(1)将1到它下一次出现的位置前更新. 不断这样转移就OK了 ------------------------ ...
- 【linux】内核make编译链接相关变量定义
欢迎转载,转载时请保留作者信息,谢谢. 邮箱:tangzhongp@163.com 博客园地址:http://www.cnblogs.com/embedded-tzp Csdn博客地址:http:// ...
- hdu 5014 思维题/推理
http://acm.hdu.edu.cn/showproblem.php?pid=5014 从小数開始模拟找方法规律,然后推广,尤其敢猜敢尝试,错了一种思路继续猜-----这是一种非常重要的方法啊 ...
- 【linux】常用网站
Kernel: http://www.kernel.org/ LSB (Linux Standard Base): http://www.linuxbase.org/ ELC(Embedded Lin ...
- C++基础学习笔记----第七课(面向对象的基本概念)
主要讲面向对象的基本概念和一些概念,以及实现简单的面向对象C++程序. 类和对象 基本概念 类和对象是面向对象中的两个基本概念,类是指一类事物,是一个抽象的概念.对象是指某一个类的实体,是一个具体存在 ...
- 实现StatusBar的Flat风格
效果见右图,OfficeXP里就是这样的风格,其实实现很简单,不必专门在网上找别人控件. 把StatusBar的SimplePanel设为False,点击Panels添加StatusPanel,把所有 ...
- uva 1343 非原创
uva1343 原作者 题目题意是:给你的棋盘,在A-H方向上可以拨动,问你最少拨动几次可以是中心图案的数字一致 解题思路:回溯法,剪枝 其中要把每次拨动的字母所代表的位置提前用数组表示: 然后在如果 ...
- Oracle实用-01:绑定变量
数据库虽然在学校系统学习过,但是在工作中真正使用起来收获又是不一样的,今天起打算将项目中使用到的技术再分享出来,不以书本的顺序,只从碰到的问题为顺序. 虽然不是纯粹的数据库工程师,但是每个程序员总免不 ...
- Mysql找回管理员password
我们使用MYSQL的时候有可能由于种种原因忘记ROOTpassword,假设是那样数据库可能就废掉了.可是今天给大家分享下找回ROOTpassword的方法或者说是在不知道rootpassword的情 ...