ファイル名とサムネイルのリストを含むtableViewを作成しています。ファイル名に問題はありませんが、 UIImage 配列を tabeView に渡すと、エラーが発生します。コードは次のとおりです。
cell.imageView.image = [UIImage imageNamed:[arrayColletionImages objectAtIndex:indexPath.row]];
私が取得したarrayColletionImages画像:
player = [[MPMoviePlayerController alloc] initWithContentURL:url];
thumbnail = [player thumbnailImageAtTime:0.0 timeOption:MPMovieTimeOptionExact];
[player stop];
[arrayColletionImages addObject:thumbnail];
すべての UITableViewCell コード:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"SimpleTableItem";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
}
cell.textLabel.text = [tableData objectAtIndex:indexPath.row];
cell.imageView.image = [UIImage imageNamed:[arrayColletionImages objectAtIndex:indexPath.row]];
NSLog(@"%@",indexPath);
return cell;
}