Async Images Code


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. [[AsyncImageCache shared] loadImageForURL:updateAnnotation.profileImageURL delegate:self];
  2.  
  3.  
  4. //---------------------------------------------------------------------
  5. // AsyncImageCache Delegate
  6. //---------------------------------------------------------------------
  7.  
  8. - (void)asyncImageCacheLoadedImage:(UIImage *)image forURL:(NSString *)url
  9. {
  10. // just in case
  11. [twitterUserIcon release];
  12. twitterUserIcon = nil;
  13.  
  14. // remember this image, if it corresponds to the expected URL
  15. UpdateAnnotation *updateAnnotation = (UpdateAnnotation *) self.annotation;
  16. if (image != nil && [url isEqualToString:updateAnnotation.profileImageURL])
  17. {
  18. twitterUserIcon = [image retain];
  19. [self fadeInNewUserIcon];
  20. }
  21.  
  22. // force full redraw
  23. [self setNeedsDisplay];
  24. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.