2

我收到此异常 [_UITableViewReorderingSupport setTableViewStyle:]: unrecognized selector sent to instance 0x70f9780

我正在为表格视图使用自定义单元格,有人可以告诉我为什么会发生这种情况吗????

if (cell == nil) { 
  cell = [[CCUnbilledTransactionCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier_3]; 
  [[NSBundle mainBundle] loadNibNamed:@"CCUnbilledTransactionCell" owner:self options:nil]; 
  cell = objCCUnbilledTransactionCell; 
  self.objCCUnbilledTransactionCell=nil; 
} 
4

1 回答 1

0

由于您的单元格不是 UITableViewCell 类型,因此出现此崩溃。您可以在调试时检查您的对象类型,如果是这种情况,您可以按如下方式进行。

尝试检查您的对象类型,如下所示:

 cell = [[CCUnbilledTransactionCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"] ;
        NSArray *toplavelobject=[[NSBundle mainBundle]loadNibNamed:@"CCUnbilledTransactionCell" owner:self options:nil];
        for(id c in toplavelobject)
        {
            if ([c isKindOfClass:[UITableViewCell class]])
            {
                cell=(YourCustomcell *) c;
                break;
            }
        }

希望对你有帮助:)

还要确保您的自定义单元格是UITableViewCell

于 2013-02-19T07:13:56.880 回答