I have a custom UITableview cell in which i have a UITextfield. The user entersdata in the textfield. When the user leaves the app i am saving the information to an array. In the viewDidDisappea method i am doing this. But my array always shows null. user entered data is not persisted. How will i do this
Right, how are you saving the array so you can access it later?
The problem is not with the array. The UITextfield data in the Custom UItableviewcell. The data in UItextfield is not saved in the array. It always returns null value, if i scroll.
Well you are auto releasing it which means it'll be destroyed at a later time. And you said that you are saving the array when the user leaves the app, where are you doing that?
Well you are auto releasing it which means it'll be destroyed at a later time. And you said that you are saving the array when the user leaves the app, where are you doing that?
ViewDidDisappear method. But the data in my textfields are not persisted. how can i persist it.
Do you mean that when you scroll down far enough to push the UITextFields out of view, when you scroll back up, the text in the fields are gone? If so, you need to store that data in array, don't auto release it otherwise it will get destroyed, and set it in cellForRowAtIndexPath.
Do you mean that when you scroll down far enough to push the UITextFields out of view, when you scroll back up, the text in the fields are gone? If so, you need to store that data in array, don't auto release it otherwise it will get destroyed, and set it in cellForRowAtIndexPath.
I have two issues. One is data is not persisted in the scroll, as well as even if after the data is entered only the cell that is visible on the screen is saved. All the textfields show only empty data.
I have two issues. One is data is not persisted in the scroll, as well as even if after the data is entered only the cell that is visible on the screen is saved. All the textfields show only empty data.
ehm......we already explained you that you must not autorelease the array...
ehm......we already explained you that you must not autorelease the array...
I have a UITableViewController with some custom cells that hold some UITextFields so the user should enter some values on them and then tap on the done button up in the navigation bar to save all the information. The problem is, if the user scrolls down and then tap on the done button the information on the text fields that is out of sight doesn't get saved. I understand the why, the UITableViewCell's that are out of sight get unallocated, so when the user saves there is basically nothing on them although if the user scroll back the information remains on the fields.
I used the array to save but same behaviour exists.
So my question is how can I retrieve the content of the text fields for saving it? [quote]
Add a tag value to your textfields. Make your view controller comply to the UITextField protocol, add the method that says something like textDidChange and in that method, check the tag value to figure out which textfield is sending the message, then save the text from that textfield somewhere.