Честно говоря, я знаю, как вставить новый пользовательский конец строки таблицы без reloadData, но теперь я хочу знать, как вставить новый пользовательский конец строки UITable во время reloadData.Вставить новую пользовательскую строку в конец таблицы, в то время как reloadData Xcode
Вот мой кусок кода, который вставляет новую пользовательскую строку в reloadData. Но новая вставленная строка появилась в верхней части таблицы, и это не то, что я хочу.
CoachPadItem *newCoachPadItem = [[CoachPadItem alloc]init];
newCoachPadItem.coachpadDescription = textView.text;
newCoachPadItem.coachpadTagId = @"0";
[_tagPointsArray addObject:newCoachPadItem];
[_coachpadTableView reloadData];
cellforrowatindexpath
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Configure the cell...
CoachPadPointCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CoachPadPointCell" forIndexPath:indexPath];
if (cell == nil) {
cell = [[CoachPadPointCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CoachPadPointCell"];
}
counter += 1;
cell.tagBtn.hidden = YES;
cell.btnRemove.hidden = YES;
cell.tagBtn.userInteractionEnabled = canEdit;
[cell.tagBtn addTarget:self action:@selector(removeTag:) forControlEvents:UIControlEventTouchUpInside];
[cell.btnRemove addTarget:self action:@selector(removePad:) forControlEvents:UIControlEventTouchUpInside];
cell.btnRemove.tag = counter;
cell.txtPoint.delegate = self;
cell.txtPoint.tag = counter;
cell.txtPoint.textContainer.maximumNumberOfLines = 2;
cell.tagBtn.tag = counter;
cell.txtPoint.textAlignment = NSTextAlignmentLeft;
cell.txtPoint.backgroundColor = [UIColor clearColor];
cell.txtPoint.userInteractionEnabled = canEdit;
cell.backgroundColor = [UIColor clearColor];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
CoachPadItem *curr = _tagPointsArray[indexPath.row];
cell.txtPoint.text = cure.MyDesc;
return cell;
}
Пожалуйста, помогите мне, как поставить новую строку в конце UITable?
Можете ли вы показать способы загрузки клеток 'cellforrowatindexpath'? – anhtu
@anhtu Я изменил свой вопрос как добавление cellforrowatindexpath. Благодарю. – ppshein
Новая строка должна быть вставлена внизу. Так странно. – anhtu