У меня есть NSMutableArray *_items
. с 3 свойствами. ярлык (* текст) имеют бирку 1000. image 1001.Как показать UIImage в UITableView в IOS
@property (nonatomic, copy) NSString *text;
@property (nonatomic, assign) BOOL checked;
@property (nonatomic, copy) UIImage *image;
проблема в том, что я не могу отобразить изображение.
_items = [[NSMutableArray alloc] initWithCapacity:20];
ChecklistItem *item;
item = [[ChecklistItem alloc] init];
item.text = @"Walk the dog";
item.checked = NO;
item.image = [UIImage imageNamed:@"img1.png"];
остальной код
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ChecklistItem"];
ChecklistItem *item = _items[indexPath.row];
UILabel *label = (UILabel *)[cell viewWithTag:1000];
UIImage *image = (UIImage *)[cell viewWithTag:1001];
image.image = item.image;
label.text = item.text;
[self configureCheckmarkForCell:cell atIndexPath:indexPath];
return cell;
}