On 02/07/2010, at 10:19 PM, sebi wrote:

> The problem is that I have thousands of files so I can't cache them all. Also 
> there might be files with the same name and I have to use the newer one. So 
> for every file access I have to look into both folders. Well, whatever, it's 
> probably a bit tedious, but should be managable...


Use the principle of copy-on-write. Load the images (or info about them) from 
your bundle, but as soon as the user changes one, you know that the file now 
needs to be copied elsewhere. Maintain some sort of index that tells your 
system where to load each image from. That way you're only pulling changed 
images from outside of your bundle, and only writing them when they have 
changed. The index can be small and lightweight and fast to parse. Big 
performance win all round.

--Graham


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to