我用文件名和缩略图列表创建 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;
}