Hi Markus,  

On Sunday, 9. June 2013 at 23:13, Markus Spoettl wrote:

> on iOS, is there any documentation on how much space an app should use at
> most when storing things in the location returned by NSFileManagers's  
> -URLsForDirectory: with NSCachesDirectory? Are there any hard numbers (like 
> for  
> example "never more than 1/20th of the entire disk", or something like that)? 
> I  
> couldn't find the slightest hint.

I don't think they're such rules. And things like 1/20th of the entire disk 
doesn't make sense either, because it's different number for 16, 32 or 64 GB 
device. My rules are - wisely utilize all available resources to make user 
happy. It's balancing on the edge … If you want to feel safer, raise your 
internal limits …
> I have an app that potentially produces a lot of cached data (downloaded from 
>  
> the network). Caching is highly beneficial to its performance, so generally 
> the  
> bigger the cache the better. Still, filling the device up until it's maxed 
> out  
> doesn't seem a good thing to do.

Depends on app, for how long user have to download these data, … If it's kind 
of magazine app, you can be nice and ask user if you can delete older issue, 
because download of the new issue can lower disk free space below some limit 
you have to choose, etc.
> Also, there's no mention on when cached files will get deleted (in case space 
>  
> runs out). The only piece of documentation with respect to deletion I came  
> across is that cache files *may* not survive an update of the app. However, 
> the  
> system surely will (have to) start deleting files before then if it runs out 
> of  
> space, no?

To quote docs:

Cached data should be stored in the <Application_Home>/Library/Caches 
directory. Examples of files you should put in the Caches 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.

There's no when, but there's that they're.

Temporary data should be stored 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.

Depends on data, sometimes NSTemporaryDirectory() is better. Data in temporary 
directory are deleted after 3 days IIRC.

Regards,
Robert
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to