我通过将目标 iOS 设置为 4 为我的客户创建了一个应用程序.
但由于应用程序仍未提交到 Apple Store,我的客户计划将其升级到 iOS 5.0.
I have made an application for my client by keeping target iOS as 4.
But since the application still not submitted to Apple store, my client is planning to upgrade it for iOS 5.0.
为此,我阅读了 Apple 的 指南,发现仅用户生成的数据或应用程序无法重新创建的数据,应存储在/Documents 目录中,其余数据应存储在/Library/Caches 目录中"
For this I read the guideline from Apple and found that "Only user-generated data or that cannot otherwise be recreated by your application, should be stored in the /Documents directory and rest should be stored to /Library/Caches directory"
在我的应用程序中,我将应用内购买的服务器模型用于非消耗性产品.为此,我将所有下载的数据(基本上是书籍或杂志)存储到 Documents 目录中.数据库也存在于同一目录中,其中包含有关下载产品的详细信息.
In my application, I am using server model of in-app purchase for non-consumable product. For this I am storing all my downloaded data (which are basically books or magazines) to Documents directory. The Database is also present in the same directory which contains the details about the downloaded products.
我的问题是,
1. 我是否必须更改代码以将下载的数据存储到 Library/Caches 目录而不是 Documents 目录?
2. 我的数据库文件应该放在哪里(文档或缓存)?
My question is,
1. Should I have to change my code to store the downloaded data to Library/Caches directory instead of to the Documents directory?
2. Where should my database file be placed (to Documents or Caches)?
如果我把它放在缓存中,那么我也必须改变检索的逻辑,因为如果数据库中存在记录,则不需要更改文件的存在,它直接打开它用户点击杂志.
If I put it products in the Caches then I have to change the logic of retrieval also, since it is considered that if record is present in database, there is no need change the existence of the file and it directly opens it when user clicks on the magazine.
请在这个问题上指导我.
提前致谢.
Kindly guide me on this issue.
Thanks in advance.
更新:
我正在为那些仍然不确定这个问题的人更新这个.
使用接受答案的指导方针,我已经在我的 2 个应用程序中实现了这一点,并将它们提交到 Apple Store.两者都在审查中获得批准.
这可能会促进接受的答案中建议的解决方案是正确的.
UPDATED:
I am updating this for those who are still not sure about this problem.
Using the guideline of accepted answer, I have implemented this in 2 of my applications and submitted them to Apple Store. Both were approved in review.
This may promote that the solution suggested in the accepted answer is correct.
以下是取舍:
但是,对于 iOS 5.0.1,还有第三种选择:
However, with iOS 5.0.1 there is a third option:
我认为这可能是最适合你的答案.
I think this is probably the best answer for you.
这篇关于iOS 5 不允许将下载的数据存储在 Documents 目录中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!