-1

Let's say there are 10 rows in my UITableView, each with its own unique information, and I delete row 4. After the action is completed, row 5 becomes row 4, row 6 becomes row 5, and so on. Well, Row 5 loads the data that was in row 4 before being deleted. How can I just delete the information that was in row 4 entirely so that row 5 doesn't become row 4. By the way, my UITableView consists of custom cells with multiple UITextField's- just so you know. I'm just brainstorming and any help/ideas would be appreciated.

batman
  • 1,937
  • 2
  • 22
  • 41

1 Answers1

3

On deleting a row and removing the data object from your datasource, the UITableView on reload or update WILL move the rows up for the updated datasource. If you want to keep the deleted row blank visually, you could delete the data object and set a flag in its place, a BOOL for instance, as a placeholder in the datasource. Then in your cellForRowAtIndexPath method, you could check for this Boolean flag and display an empty UITableViewCell.

batman
  • 1,937
  • 2
  • 22
  • 41