Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Binju

macrumors member
Original poster
Jan 31, 2010
65
0
Its a simple thing but i get confused,
I need to display 4 images in the 4 imageviews from the server,button1 - image1,button2 -image2

I used the below code
Code:
for(i=1;i<=count;i++)
{
myimage=[[stream objectAtIndex:0] objectForKey:@"Imagelink"];
	NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: myimage]];
	imageview1.image =[UIImage imageWithData: imageData];
    imageview2.image =[UIImage imageWithData: imageData];
}


Both imageviews loaded same image only.ie the last image.Is it possible to use the imageview name as imageview+i?
 
Regardless of what the value of i us you are always reading from the stream (whatever that is: you haven't told us) at index 0. As I don't know what stream is that may or may not be an error but it looks wrong to me.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.