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

AbhishekApple

macrumors member
Original poster
Aug 5, 2010
86
0
Whn i call setProductImage() method the NSData gets data only for the first time in the loop so only first image is displayed..
I have checked the url it is retrieving the image every time. but data is not loaded in NSData

Their is no error in the tableview only first cell gets image and label values but other cells gets only label values.

Code:
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *imgPath = [NSString alloc initWithFormat:@"http://www.xyz.com.com/images/%@",arryImage objectAtIndex:indexPath.row];
cell setProductImage:imgPath;
return cell;
}

(void)setProductImage:(NSString *)_text;{
NSData * imageData = [[NSData alloc initWithContentsOfURL:NSURL URLWithString:_text]] autorelease;
imgProduct.image = UIImage imageWithData: imageData; //UIImageView imgProduct 
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.