Loop agregar UIImageView Cocoa Touch

Tener un problema al agregar múltiples ImageViews a mi vista. Tengo una gran variedad de imágenes y qué recorrerlas y agregarlas a mi vista. Este fragment agrega una image para ver, ¡pero sin marco!

- (void)cycleImages:(NSArray *)images { //create an image view int fromLeft = 5; int profilesCount = [images count] - 1; for(int n = 0; n <= profilesCount; n++){ //add image view to view [self.view addSubview:[[[UIImageView alloc] initWithFrame:CGRectMake(5, fromLeft, 48, 48)] initWithImage:[[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[images objectAtIndex:n]]]]]]; fromLeft = fromLeft + 53; NSLog(@"%d", fromLeft); } } 

¡Gracias por tu ayuda!

Dex

Es difícil leer dicho código y tiene filtraciones de memory. Por favor, intente esto.

 - (void)cycleImages:(NSArray *)images { int fromLeft = 5; NSURL* url = nil; UIImage* img = nil; UIImageView* imgView = nil; NSData* imgData = nil; for (NSString* imgURLStr in images)//Using enumeration much more easy and in ObjC style { //Put breakpoint here and check all varibles initialized coorecly step by step url = [NSURL URLWithString:imgURLStr]; imgData = [NSData dataWithContentsOfURL:url]; img = [[UIImage alloc] initWithData:imgData]; imgView = [[UIImageView alloc] initWithImage:img]; imgView.frame = CGRectMake(5, fromLeft, 48, 48); [self.view addSubView:imgView]; fromLeft = fromLeft + 53; NSLog(@"%d", fromLeft); //Clean up [img release]; [imgView release]; } } 

¡Gracias!