lunes, 10 de septiembre de 2012

UIImage from URL

UIImage * img = [[UIImage alloc] initWithData: 
[NSData dataWithContentsOfURL: 
[NSURL URLWithString:@"http://example.com/image.png"]]];
 
 
Si queremos cargar la imagen de un archivo del proyecto:
 
[UIImage imageWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"thefilename" ofType:@"jpg"]]; 

No hay comentarios:

Publicar un comentario