iPhone tableview edit delete and add button
I need to make a selection screen pop up after a long press on a tableview.
In this selection screen I need 3 options:- 1 for editing the long pressed cell
- 1 for deleting the cell
- 1 for adding a new cell.
How can I do this?
I know how to do something when a cell is clicked, but I don't know how I can edit/delete a cell.
Just one more small question:
When this cell has been edited and the application terminates, I need to save all the cells to a file calledexerci开发者_JAVA百科ses
.
This file already contains the array/cell of cells that the app started with so I need to delete all the content and then write it again.The tableview delegate protocol has standard methods for handling the editing of the tableview. See the Table View Programming Guide for iOS.
If you are saving the data from the table in an array, you can overwrite the existing file just by calling -[NSArray writeToFile:]
and providing the same path.
精彩评论