IOS Data Storage
来源:互联网 发布:淘宝新店引流方法 编辑:程序博客网 时间:2024/04/27 13:41
应用又被拒绝了,原因是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恢复
[[NSURLURLWithString:resource]setResourceValue:@(YES)
forKey:NSURLIsExcludedFromBackupKey
error:nil];
Library/Preferences:我们不需要自己创建文件进去,这个目录一般是程序使用NSUserDefaults存储数据的地方。支持iTunes恢复。
Library/Caches: 这个目录可以用来存储任何文件,包括用户的数据。IOS2.2之后caches就不在支持iTunes恢复,并且会在iTunes恢复时被清空,IOS5之后系统会在硬盘紧张时清空该目录。所以用来存储用户数据需要谨慎,最好是放到Documents。
Tmp: 在程序运行的时候可用来存放临时文件,文件不再需要时需要自己手动移除,当然系统在程序没有运行时也会定期清空,不支持iTunes恢复。
PS:用到的同学请点个赞吧
- iOS Data Storage Guidelines
- IOS Data Storage
- ios 审核 2.23 iOS Data Storage 解决方案
- iOS Data Storage问题导致审核不通过
- Data Storage
- Data Storage
- iOS Data Storage Guidelines 和 "do not back up"文件属性
- iOS Data Storage Guidelines 和 "do not back up"文件属性
- Alternate Data Storage Forensics
- Android data-storage
- Android Data Storage
- Android-Data Storage
- Swift data storage
- ios 文件存储 iOS Data Storage Guidelines 和 "do not back up"文件属性
- Designing Data Storage Architecture-Azure Storage Options
- 2.23 Apps must follow the iOS Data Storage Guidelines or they will be rejected
- 2.23 Apps must follow the iOS Data Storage Guidelines or they will be rejected
- 2.23 Apps must follow the iOS Data Storage Guidelines or they will be rejected
- 第32课第二题
- ASP.NET分页显示技术
- java对sql_server的操作
- Android adb shell读取手机上的QQ软件的sqlite数据库
- Android实战技巧之二十八:启动另一个App/apk中的Activity
- IOS Data Storage
- 记录一下——C读取指定文本
- 实时显示iOS编写UI代码效果
- Android 屏幕适配方案
- PUT 还是 POST ?
- Process 创建+控制+分析 经验浅谈(3)
- 当习惯成为自然
- Unable to recreate missing debug keystore.
- jquery autocomplete 搜索框提示 输入自动补全