【发布时间】:2012-09-29 11:42:39
【问题描述】:
直到 2 天我试图从 plist 文件中加载一些图像到我的表视图行中。添加此行时,我创建了 NSMutableArray
cell.imageView.image = [UIImage imageNamed:[images objectAtIndex:row]]; 返回之前的“cellForRowAtIndexPath”方法,xcode 给了我这个错误:
使用未声明的标识符“cell”和指向整数转换的不兼容指针将双精度发送到 NSUInteger 类型的参数。
有什么问题?
【问题讨论】:
-
一点代码可能会有所帮助
-
试试这个 NSString *CellIdentifier = [NSString stringWithFormat:@"%i",indexPath.row]; UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
-
@Venkat Manohar 我试过你的代码机器人没有图像。
-
我也试过这个 cell.imageView.image = [UIImage imageNamed:[images objectAtIndex:indexPath.row]];但“细胞”一词有错误。我对 plist 中的行标签做了同样的事情,而且效果很好!为此,我有这一行: RowContent.textLabel.text = [texts objectAtIndex:indexPath.row];但如果我将这条线用于图像,它就不起作用了!
-
你能在这里发布你的 cellForRowAtIndexPath 方法吗?我们或许可以通过这种方式提供帮助。
标签: ios image uitableview