开发者

iPhone storage in tmp directory

I have a question from this stackoverflow question about iPhone storage. Like I already tried to answer, we can cache data in tmp directory. But a comment says that the data can be deleted when OS whimp. I don't understand exactly the problem that the comment says.

I want to开发者_如何学C ask if the process of OS deleting tmp directory is manually or automatically. In other words, if the system auto detect that our tmp directory has to be deleted.

Another question is that if we can control, or be asked to do something (before the deleting process) that can help us to keep the tmp directory.

Another question is that if we can not do anything then how often the OS will do that, under what circumstances


The OS will delete the temp directory on restart and at other indeterminate points. If you need to store something somewhere that you don't want backed up then use the cache directory. That will not be deleted and will not be backed up.

Your application will not be running when the temp is deleted nor will you have an opportunity to react to that deletion. This is fairly common behavior on all unix based platforms (OS X does this as well).


In iOS 5, OS can anytime clean cache and tmp directories. Only files in documents directory won't be deleted. These files will be also backed up to iCloud, so they shouldn't be big.

Here is great article about this issue: iOS 5 caches cleaning

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜