[2014-04-10]unable to …

来源:互联网 发布:淘宝的港货可以买吗? 编辑:程序博客网 时间:2024/04/30 08:45

 

Terminating app due to uncaught exception'NSInternalInconsistencyException', reason: 'unable to dequeue acell with identifier Cell - must register a nib or a class for theidentifier or connect a prototype cell in a storyboard'


对于这种问题,解决方法:在

 

- (UITableViewCell*)tableView:(UITableView *)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath

{

}

中加入   [self.tableViewregisterClass:[UITableViewCell class]forCellReuseIdentifier:CellIdentifier];

- (UITableViewCell *)tableView:(UITableView *)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath

{

......

 [self.tableView registerClass:[UITableViewCell classforCellReuseIdentifier:CellIdentifier];

......

 

}

0 0