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.
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
}