I have set up a sharedCache using ASIHttprequest and it is created from the xml I parse in my subview. I was woundering if I can then access that sharedCache from my mainview to do a few things things that will speed my tables up?
any idea, suggestions, thoughts of examples would be greatly appreciated.
There’s already a
sharedCacheprovided byASIDownloadCache. It’s visible anywhere in your application (assuming you#import "ASIDownloadCache.h"), so you should be able to call[ASIDownloadCache sharedCache]and use it.EDIT: To use several caches is not too tricky. Create a separate class which is included by both your main view and your subview. In there, define a method to return one or more
ASIDownloadCacheobjects, and provide an implementation, similar to this:DownloadCaches.h
DownloadCaches.m
You only ever need to call
[DownloadCaches imageCache]and it will be initialised if not already, and then returned to you.