-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] ERROR
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
?
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized selector sent to instance 0x7257800'
今天新建立一个TableView的时候,偶然发现这样的错误,因为用的是XCode自己生成的代码,好奇怪,想了想到底是为什么呢?
看了下Documents,oh shit!我用的Base 是5.0SDK.
?
Available in iOS 6.0 and later.
遂改之:
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
本文介绍了一个UITableView单元格重用导致的错误,并提供了解决方案。在使用较旧的iOS SDK版本时,尝试调用仅在iOS 6.0及更高版本可用的方法会触发异常。文章详细说明了如何修改代码以避免此问题。
13

被折叠的 条评论
为什么被折叠?



