Question

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
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top