invalid mode 报错

来源:互联网 发布:大数据进阶 编辑:程序博客网 时间:2024/06/06 19:53

invalid mode 报错

报错信息如下

*** Assertion failure in -[GroupShadowTableView _dequeueReusableCellWithIdentifier:forIndexPath:usingPresentationValues:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3698.21.8/UITableView.m:7810invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.

在iOS10能正常运行,但在iOS11就会carsh,报错信息如上,网上搜的出现这种情况场景比较多,有内存泄露的,也有因xib是控件连线错误的,于是各种验证,各种试,最终找到问题出在哪了,因为cell是自定义高度的,平时都是直接用代码块声明tableView,没注意到这个问题,有问题代码如下

- (UITableViewCell *)groupShadowTableView:(GroupShadowTableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {    AutobillingCell *cell = [tableView dequeueReusableCellWithIdentifier:AutoCellIDForList forIndexPath:indexPath];    if (!cell) {        cell = [[AutobillingCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:AutoCellIDForList];    }    cell.model = self.dataArray[indexPath.section];    return cell;}

    AutobillingCell *cell = [tableView dequeueReusableCellWithIdentifier:AutoCellIDForList forIndexPath:indexPath];

换成

 AutobillingCell *cell = [tableView dequeueReusableCellWithIdentifier:AutoCellIDForList];

搞定收工!

阅读全文
0 0