我已經完成了一百萬個UITables - 帶有字幕,圖像,背景,顏色,文本樣式 - 您的名字。突然間,我在這張桌子上轟然倒塌,特別是在調用單元格圖像的線上。 下面的代碼:UITableView圖像導致崩潰
// 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?它是一組圖像嗎? – Vaquita
你是如何在「leadershipPhotosMenu」數組中存儲圖像的?我可以看看它是什麼嗎? –
當然,這裏的代碼是:'leadershipPhotosMenu = [[NSMutableArray alloc] initWithObjects:@「JohnQ.jpg」,@「BillZ.png」,nil];'那些圖像在我的項目中 - 意味着它們在Xcode中,包的一部分。 – sirab333