Я пытаюсь добавить изображение в каждую ячейку моего табличного представления:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSString *ligneTableau = [NSString stringWithFormat:@"%@", [[tableau objectAtIndex:indexPath.row] label]];
cell.textLabel.text=ligneTableau; // Configure the cell.
cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"images/sections/%@.png", [[tableau objectAtIndex:indexPath.row] key]]];
return cell;
}
Когда я NSLog () строка imageNamed, я получаю хороший URL ("images / section / name.png"). Все мои изображения находятся в подпапке "images" моего проекта как "images / section / name.png".
Но мои изображения не появляются в моих строках, но если я заменю images / section /% @. Png именем файла изображения в корне моего проекта, это сработает.
Почему я не могу прочитать изображения моей подпапки?
Спасибо (я новичок)