views:

233

answers:

1

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

+1  A: 

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.

TechZen
m doing the same...i created an array and passed these value to the array and trying to set these values on table view,but getting null values there.regardsshishir
shishir.bobby
Can't tell without seeing the code. Either your not putting data into the array like you think or your putting into the wrong index. You may need to call reload on the tableview.
TechZen
let me describe u in detail,i am getting my data in array.i can c in console.and also as i load the data into table, i reload table ..than also its not working.....i m confused
shishir.bobby
What do you mean by "not working"? Does the data not appear? Does it appear in the wrong place? Does it crash?
TechZen
data is coming up,on very first row of the table,in a single row.its about 40 to 50 row of data is there,but whole data is coming up in a single row.
shishir.bobby
It sounds like you not indexing the array to the table rows. Each row should be populated from the corresponding element in the array. Both are zero indexed so [theArray objectAtIndex:0]-->data displayed in row 0 (which is the first visible row.) Can't advise further without code.
TechZen