当我尝试对自定义单元格使用以下编码时,它显示错误。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"SimpletablcellCell";
SimpletablcellCell *cell = (SimpletablcellCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpletablcellCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.nameLabel.text = [ar objectAtIndex:indexPath.row];
cell.thumbnailImageView.image = [UIImage imageNamed:[ar1 objectAtIndex:indexPath.row]];
cell.prepTimeLabel.text = [ar objectAtIndex:indexPath.row];
return cell;
}
错误信息
'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/apple/Library/Application Support/iPhone Simulator/6.0/Applications/FE02B3A1-C40C-4FAC-BBA6-B245350F3754/SImpleTab.app> (loaded)' with name 'SimpletablcellCell''
*** First throw call stack:
(0x1c8f012 0x10cce7e 0x1c8edeb 0x22ffac 0x23198d 0x3418 0xcef4b 0xcf01f 0xb780b 0xc819b 0x6492d 0x10e06b0 0x228bfc0 0x228033c 0x228beaf 0x1038cd 0x4c1a6 0x4acbf 0x4abd9 0x49e34 0x49c6e 0x4aa29 0x4d922 0xf7fec 0x44bc4 0x44dbf 0x44f55 0x4df67 0x2d40 0x117b7 0x11da7 0x12fab 0x24315 0x2524b 0x16cf8 0x1beadf9 0x1beaad0 0x1c04bf5 0x1c04962 0x1c35bb6 0x1c34f44 0x1c34e1b 0x127da 0x1465c 0x29fd 0x2925)
libc++abi.dylib: terminate called throwing an exception
请检查,这段代码有什么问题?