Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 05-13-2009, 10:12 AM   #5 (permalink)
dvpweb
New Member
 
Join Date: May 2009
Posts: 1
dvpweb is on a distinguished road
Default Brilliant Example!

Hey first off - thanks so much for your example- I'm very new to obj C and IPhone dev and found this utility to be very useful. Caching is such a common task.

Some brief questions and suggestions:

1> Where does the file go? What about cleanup, I'd hate to cache a few hundred images and then leave them in limbo?
I did a NSLOG and see the file goes here...
/var/folders/RJ/RJWwAcBZFtC36gaSUm0wKU+++TI/-Tmp-/ad.jpg

I tried to use finder to actually find the file to delete it, so I can test it again.

Suggestions or maybe post some additional help to extend the utilities class with two additional method (clearImage) to have a clear a single image (by filename) or the entire image cache (clearImageCache) ?

BTW - I updated your original code to take a filename arg. It seemed like you'd want a handle on that - for doing things like the forementioned cleanup..

Finally - here's an example of how to create and call your class:

// Assumes you've included the class in the header.
// ImageName is the url of an image (NSSTRING)
//imgView is the image (UIImageView)

Utilities *utils = [[Utilities alloc] init];
UIImage *tempImg = [utils getCachedImage:ImageName];
[imgView setImage:tempImg];
// ...
[Utilities release];

Again fab example!

Last edited by dvpweb; 05-13-2009 at 10:14 AM.
dvpweb is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,638
Threads: 94,101
Posts: 402,822
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Studder
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:33 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.