1. 程式人生 > >failed to obtain a cell from its dataSource 解決方案

failed to obtain a cell from its dataSource 解決方案

    使用iOS的tableView時,如果建立的是reuse cell,即在使用了類似如下的方法:

BPTimeLineCell *cell = [tableView dequeueReusableCellWithIdentifier:kTimeLineTableViewCellId];

    則需要在viewDidLoad中註冊一個reUseCell:

[self.tableView registerClass:[BPTimeLineCell class] forCellReuseIdentifier:kTimeLineTableViewCellId];

    就能解決這樣的錯誤啦:    
failed to obtain a cell from its dataSource (<_UIFilteredDataSource: 0x7b8b6570>)'