Вопрос

I have a tableview with a custom cell. Then labels that the user inputs data. What would be the best way to make the first cell of the table record the data the user inputed then the next row record new data that is inputed.

So

  1. User inputs data
  2. First cell records data
  3. Insert new cell
  4. User inputs new data
  5. Second row records new data
Это было полезно?

Решение

To access the cells you can do the following

UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:yourIndexPath];

Then you can get the values of your label using cell.myLabel.text, though I would suggest using a UITextField instead for inputting text

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top