Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a pr

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

{

staticNSString *CellIdentifier =@"Cell";[self.tableView registerClass:[UITableViewCellclass] forCellReuseIdentifier:CellIdentifier];UITableViewCell*cell =[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];if(cell ==nil)

{

cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];

cell.selectionStyle=UITableViewCellSelectionStyleNone;

}//config cell...

returncell;

}


主要是加入了这句话解决


[self.tableView registerClass:[UITableViewCellclass] forCellReuseIdentifier:CellIdentifier];

你可能感兴趣的:(Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a pr)