Top cell name changes when changing any cell name

前端 未结 2 934
[愿得一人]
[愿得一人] 2021-01-26 17:59

I have a HabitViewController (UITableViewController) with a button to add cells. When a cell is added its default title is \"New Habit\". Then the user

2条回答
  •  走了就别回头了
    2021-01-26 18:18

    IN cellForRowAtIndexPath

    if(indexPath.row == object.count-1)
      cell.textLabel.text = @"New Habit";
    else
    {
       NSDate *object = _objects[indexPath.row];
       cell.textLabel.text = [object description];
    
    }
    
        return cell;
    

提交回复
热议问题