简体   繁体   中英

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 ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM