【发布时间】:2012-06-28 11:22:17
【问题描述】:
我已经完成了一百万个 UITables - 带有字幕、图像、背景、颜色、文本样式 - 随便你说。 突然,我在这张桌子上崩溃了,特别是在需要细胞图像的那一行。 代码如下:
// Configure the cell:
cell.textLabel.font = [UIFont fontWithName:@"Franklin Gothic Book" size:18];
cell.textLabel.text = [leadershipMenu objectAtIndex:indexPath.row];
cell.detailTextLabel.text = [leadershipSubtitlesMenu objectAtIndex:indexPath.row];
// And here's the statement that causes the crash:
cell.imageView.image = [leadershipPhotosMenu objectAtIndex:indexPath.row];
现在,我得到的错误是:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[__NSCFConstantString _isResizable]: unrecognized selector sent to instance 0xcacbc'
我确定导致崩溃的语句是
cell.imageView.image = ...
因为一旦我将其注释掉,一切正常。
我这辈子都没见过
-[__NSCFConstantString _isResizable]:
错误。 我已经用谷歌搜索了它,但发现很少。
非常奇特。
有人知道线索吗?
【问题讨论】:
-
什么是leadershipPhotosMenu?它是一组图像吗?
-
您是如何将图像存储在“leadershipPhotosMenu”数组中的?我可以看看它是什么吗?
-
当然,这是代码:
leadershipPhotosMenu = [[NSMutableArray alloc] initWithObjects:@"JohnQ.jpg", @"BillZ.png", nil];这些图像在我的项目中 - 意味着它们在 Xcode 中,是捆绑包的一部分。
标签: iphone uitableview uiimageview uiimage