У меня есть статическая таблица, созданная в Interface Builder с 6 разделами с разным количеством строк. Теперь я хочу добавить 7-ю секцию с различным количеством строк.
Прежде всего, как только я раскомментирую стандартные методы делегата таблицы, которые вставлены Xcode, я получаю сбой в self.tableView.tableHeaderView = containerView; где я добавил заголовок в таблицу.
Более того, я получаю сбой со следующим кодом
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 7;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section==6) {
return 4;
} else {
return [super tableView:tableView numberOfRowsInSection:section];
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{/*
if (indexPath.section == 6) {
static NSString *CellIdentifier = @"cellWireless";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
return cell;
}*/
return [super tableView:tableView cellForRowAtIndexPath:indexPath];
}
Как я могу оставить существующие разделы такими, какие они есть, но добавить дополнительный с несколькими ячейками?