IOS Data Storage

应用又被拒绝了,原因是IOS Data Storage

为了区分清楚sandbox里边各个目录的作用,我去看了下apple文档,sandbox目录介绍

总结下:

Documents:存放用户产生的数据,比如用户下载的视频图书,浏览记录等。但是对于位于Documents中可在生成或可重新下载的资源,必须标记为不能通过iTunes恢复的类型(NSURLIsExcludedFromBackupKey)(意思是说文件太大了,又是个动态的,不需要备份)。翻译的比较挫,看下官方的原话,自己体会下:

Remember that files in Documents/ and Application Support/ are backed up by default. You can exclude files from the backup by calling -[NSURL setResourceValue:forKey:error:] using the NSURLIsExcludedFromBackupKey
key. Any file that can be re-created or downloaded must be excluded from the backup. This is particularly important for large media files. If your application downloads video or audio files, make sure they are not included in the backup.

具体方法:

//标记文件夹不可从iTunes恢复

[[NSURL
URLWithString:resource]
setResourceValue:@(YES)

forKey:NSURLIsExcludedFromBackupKey

error:nil];

Library/Preferences:我们不需要自己创建文件进去,这个目录一般是程序使用NSUserDefaults存储数据的地方。支持iTunes恢复。

Library/Caches: 这个目录可以用来存储任何文件,包括用户的数据。IOS2.2之后caches就不在支持iTunes恢复,并且会在iTunes恢复时被清空,IOS5之后系统会在硬盘紧张时清空该目录。所以用来存储用户数据需要谨慎,最好是放到Documents。

Tmp: 在程序运行的时候可用来存放临时文件,文件不再需要时需要自己手动移除,当然系统在程序没有运行时也会定期清空,不支持iTunes恢复。

PS:用到的同学请点个赞吧

时间: 2024-08-25 19:44:55

IOS Data Storage的相关文章

iOS Data Storage Guidelines 和 "do not back up"文件属性

OS 5有了iCloud后,Apple更新了数据存储指导方针,以适应于iCloud存储,同时增加了“不要备份”文件属性,可以指定文件不备份和上传到iCloud 摘录如下,供大家参考: iOS 数据存储指导方针 iCloud包括了备份,会通过Wi-Fi每天自动备份用户iOS设备.app的home目录下的所有东西都会被备份,除了应用Bundle本身.缓存目录和temp目录.已购买的音乐.应用.书籍.Camera Roll.设备设置.主屏幕.App组织.消息.铃声也都会被备份.由于备份通过无线进行,并

Data storage on the batch layer

4.1 Storage requirements for the master dataset To determine the requirements for data storage, you must consider how your data will be written and how it will be read. The role of the batch layer within the Lambda Architecture affects both values. I

API翻译 --- Data Storage

Data Storage    数据保存 Store application data in databases, files, or preferences, in internal or removeable storage. You can also add a data backup service to let users store and recover application and system data. 可以在数据库,文件,内部储存,可移动储存中,储存应用程序的数据.你也可

翻译:《Pro SQL Server Internals, 2nd edition》CHAPTER 1 Data Storage Internals中的Data Pages and Data Rows一节

原文链接:file:///E:/%E2%80%9C%E6%B2%BB%E6%9C%AA%E7%97%85%E2%80%9D%E5%81%A5%E5%BA%B7%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/Pro%20SQL%20Server%20Internals,%202nd%20edition.pdf 原著:<Pro SQL Server Internals> 作者:Dmitri Korotkevitch 翻译: 数据页面和数据行 数据库中的空间分为逻辑8KB页

(翻译内容)《Pro SQL Server Internals, 2nd edition》的CHAPTER 1 Data Storage Internals中的Data Pages and Data Rows一节(即P8~P14)

原文链接:file:///E:/%E2%80%9C%E6%B2%BB%E6%9C%AA%E7%97%85%E2%80%9D%E5%81%A5%E5%BA%B7%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/Pro%20SQL%20Server%20Internals,%202nd%20edition.pdf 原著:<Pro SQL Server Internals> 作者:Dmitri Korotkevitch 翻译: 数据页面和数据行 数据库中的空间分为逻辑8KB页

X-OWA-Error:Microsoft.Exchange.Data.Storage.出错

今天遇到一个问题,就是用户的邮箱在用Outlook配置时出错,无法完成.然后我就尝试用网页版登录,会出现以下错误. 我尝试给这个用户发一个邮件,收到此用户邮件被隔离的报错. Your message wasn't delivered because the recipient's mailbox is quarantined. If the problem continues, please contact your helpdesk. 遇到这个问题后,登录邮件服务器,然后用以下命令先是查看一下

iOS 审核app被拒绝的各种理由以及翻译

原 apps被拒绝的各种理由以及翻译:http://my.oschina.net/201003674/blog/356189#OSC_h1_3 1. Terms and conditions(法律与条款) 1.1 As a developer of applications for the App Store you are bound by the terms of the Program License Agreement (PLA), Human Interface Guidelines

iOS审核被拒大全

崩溃和bug 当你完成应用开发并准备发布时应该将App提交审核.在提交审核前,要确保已经在设备上对应用程序进行了彻底的测试,修复了所有的bug. 断掉的链接 应用程序中所有的链接必须是功能性的.对于所有应用程序来说,链接至一个提供最新联系信息的用户支持是必需的.如果你提供了一个可自动更新或免费订阅的链接,再或者你的应用属于儿童类别,那么你必须提供一个链至你的隐私策略的链接. 占位符内容 在提交应用进行审核之前要完成所有的图片和文本.仍处于开发阶段或者包含占位符内容的应用不能准备发布,也不能通过审

iOS提交AppStore被拒原因

1. Terms and conditions(法律与条款) 1.1 As a developer of applications for the App Store you are bound by the terms of the Program License Agreement (PLA), Human Interface Guidelines (HIG), and any other licenses or contracts between you and Apple. The fo