Posted By

ollie on 11/14/09


Tagged

image pixel profile identity avatar retro


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

umang_nine
bobbym245


Using the Retro Avatar API in iPhone


 / Published in: iPhone
 

URL: http://retroavatar.appspot.com/

How to dwonload and use a Retro Avatar image in a iPhone App. In this example: uid is a Facebook user id, optionally you can use any string, a name, a md5 hash of a email address and it is assumed you have an image view with tag id 1 you want to set the image for

  1. NSString *name = [NSString stringWithFormat:@"http://retroavatar.appspot.com/api?name=%d&alpha=true&fact=2", uid];
  2. NSURL *url = [NSURL URLWithString:name];
  3. NSData *data = [NSData dataWithContentsOfURL:url];
  4. UIImage *img = [UIImage imageWithData:data];
  5. ((UIImageView *) [self.view viewWithTag:1]).image = img;

Report this snippet  

You need to login to post a comment.