I無法加載與tableviewcell類一起作爲.xib使用的uitableviewcell。請提前幫助我。無法在名稱爲'itemCell'的包中加載NIB
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellId = @"itemCell";
NSDictionary *dictDetailList = [_arrItemList objectAtIndex:indexPath.row];
HomeRestuTableViewCell *cell = (HomeRestuTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellId];
if(!cell) {
[tableView registerNib:[UINib nibWithNibName:@"itemCell" bundle:nil] forCellReuseIdentifier:cellId];
cell = (HomeRestuTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellId];
}
[cell setupHomeRestuCell:dictDetailList];
return cell;
}
你收到了什麼錯誤?你是如何創建你的tableView? –
基本上從不在'cellForRow ...'中註冊單元格' – vadian