UITextField in Custom UITableViewCell Not Updating
So I have a View where users can modify information about a company, the view works great the first time to click on a company, when you close the view (Using Navigation to go back), and click on another company.. the view comes up with all the same data.. I've already added a [self.tableView reloadData]; to the viewWillAppear and that doesn't seem to fix it.. Only way I can fix it, is to NOT reuse cells.. See code not working below, then the modified code that works.. can anyone explain this to me? I think it's a bad idea to NOT reuse the cells.... Any help would be greatly appreciated..
So I have a View where users can modify information about a company, the view works great the first time to click on a company, when you close the view (Using Navigation to go back), and click on another company.. the view comes up with all the same data.. I've already added a [self.tableView reloadData]; to the viewWillAppear and that doesn't seem to fix it.. Only way I can fix it, is to NOT reuse cells.. See code not working below, then the modified code that works.. can anyone explain this to me? I think it's a bad idea to NOT reuse the cells.... Any help would be greatly appreciated..
From what I can tell there can be several reasons for this behavior. Best would be to debug through the steps and see when your datasource is asked for the company name. it's possible that at the time of your calling of viewWillAppear the datasource still provides the old data.
If I could look at the code I could probably find the reason for this in 15 minutes or less.
__________________
regards
Oliver Drobnik Cocoanetics - Our DNA is programmed in Objective-C.
Cocoanetics Parts Store – easy to use yet professionally looking components that you can use to spruce up your own apps. Augmented Reality, Calendar Control, Pin Lock or Purchase Button are only some examples. You get full source code, no static library crap, and lifetime support. Check it out today!
Yeah, prior to posting I stepped through the whole thing, on the second time into the view, the selectedClient is set properly, the code runs which assigns it's text value to the UITextField.text property, but it still shows the old value...
Can I PM you the .m file?
Quote:
Originally Posted by Oliver Drobnik
From what I can tell there can be several reasons for this behavior. Best would be to debug through the steps and see when your datasource is asked for the company name. it's possible that at the time of your calling of viewWillAppear the datasource still provides the old data.
If I could look at the code I could probably find the reason for this in 15 minutes or less.
Yeah, prior to posting I stepped through the whole thing, on the second time into the view, the selectedClient is set properly, the code runs which assigns it's text value to the UITextField.text property, but it still shows the old value...
Can I PM you the .m file?
No, it would be better if we screen shared over Skype. I'm TheDrops.
__________________
regards
Oliver Drobnik Cocoanetics - Our DNA is programmed in Objective-C.
Cocoanetics Parts Store – easy to use yet professionally looking components that you can use to spruce up your own apps. Augmented Reality, Calendar Control, Pin Lock or Purchase Button are only some examples. You get full source code, no static library crap, and lifetime support. Check it out today!