I have a UITableView with custom cells,those cells contain some textFields,segmented index and all.Once i entered the data in particular cell textfield and segmented index after that i scrolled the tableview data contents disappears and overlapping.Can anyone tell me how to resolve the issue and how should i code.
Asked
Active
Viewed 470 times
1
-
You're re-adding the textfield to every cell instead of checking to see if it already exists. – max_ Aug 20 '14 at 11:16
-
ok @max_ then how should i check every cell.Any codes? – Ganesh Kumar Aug 20 '14 at 11:22
-
1No codes, I charge by the hour if you'd really like some. Add the text field to the cell when you check to see if it's nil, and then see if the cell's subview contains a text field when it isn't. If you're using a custom cell, make sure that you're implementing prepareForReuse. – max_ Aug 20 '14 at 11:23
1 Answers
1
Use IBOutlet in UITableViewCell because if you create segmented control,textfield as subviews after scrolling down they will be added as subviews every time you Scroll.

bhargavisridharan
- 207
- 2
- 12
-
I use IBOutlet in a custom cell class subclassed from UITableViewCell and IBOutlet directive does not work the way it should / you describe. I have made many tables and this really surprise me. First I register the cell nib and use dequeueReusableCellWithIdentifier:kCellIdentifier. – Vladimír Slavík Mar 25 '15 at 16:43