iPhone: Insert New Row at Row One of a Table View
I capture values from three text fields labeled to, from and message.
When the user fills in these开发者_运维知识库 three text fields and hits a button, I need the values in these three textfield to be displayed in a new row 1 of a table view i.e. the new row should be the first row pushing the previously existing rows downward.
How can I do this?
Regards, shishir
The data that defines the rows of your tableview will be held in data collection of some kind such as an array. You need to add the new data to insert the data from the fields into the first index position of the array. When the table reloads, its data source will read the array in order and the new data will appear in the first row of the tableview automatically.
精彩评论