views:

46

answers:

2

I want to be able to add 1 cell to the top of a UITableView after the user clicks on a button. How can I achieve this?

Update: I also want to hide the cell if the user clicks another button

+2  A: 

You can either call UITableView's insertRowsAtIndexPaths:withRowAnimation: to animate the insertion. Otherwise, you can just update your datasource without calling this method.

Jacob Relkin
A: 

In order to do this you have to use the Navigation Controller, this is because once the user clicks the button your are suppose to send the user to a new view that edits and adds the new cell to the UITableView.

flopex