Reputation: 819
I'm doing this :
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier];
cell.imageView.image = [UIImage imageNamed:[[self.articlesArray
objectAtIndex:indexPath.row]objectForKey:@"images"]];
// [cell.imageView setImageWithURL:[NSURL URLWithString:[[self.articlesArray
objectAtIndex:indexPath.row]objectForKey:@"images"]]];
}
return cell;
}
I'm doing this:
cell.imageView.image = [UIImage imageNamed:[[self.articlesArray
objectAtIndex:indexPath.row]objectForKey:@"images"]];
But nothing is showing in my UITableViewCell
.
And I want to show image in left of tableViewCell
on left side ,
Please tell me how can I do this.
Upvotes: 3
Views: 866
Reputation: 819
I've done it by myself.
here is the solution, and it works perfectly.
NSData* imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:
[[self.articlesArray objectAtIndex:indexPath.row]objectForKey:@"images"]]];
UIImage* image = [[UIImage alloc] initWithData:imageData];
cell.imageView.image =image;
Upvotes: 1