У меня есть представление с 3 представлениями таблицы.Каждое табличное представление будет использовать одно «Пользовательское представление ячейки».Я использую следующий код.Но это показывает только один вид таблицы.Кто-нибудь может указать мне, почему?(Все массивы заполнены необходимыми объектами)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString* cellID = @"CustomSyncCell";
CustomCellView* cell = (CustomCellView*)[tableView dequeueReusableCellWithIdentifier:cellID];
if(cell == nil)
{
NSArray* nibObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCellView" owner:nil options:nil];
for(id currentObject in nibObjects)
{
if([currentObject isKindOfClass:[CustomCellView class]])
{
cell = (CustomCellView*)currentObject;
}
}
}
ObjectDetails* obj;
if(tableView == phoneNumbersTable)
{
obj = [phoneNumbersArray objectAtIndex:indexPath.row];
}
else if(tableView == mailIDsTable)
{
obj = [mailIDsArray objectAtIndex:indexPath.row];
}
else if(tableView == socialUpdatesTable)
{
obj = [socialUpdatesArray objectAtIndex:indexPath.row];
}
cell.keyLabel.text = [self returnPhoneType:obj.objKey];
cell.valueLabel.text = obj.objValue;
return cell;}