I have a UITable with few custom cells which contains text fields. However when up scroll up and down the the order of those cells are messed up.
I searched and this is not working for me cos I have few UITextFields where I need to grab user inputs for those.
UITableViewCell showing indexpath rows out of order
Thank You
You either need to use a unique identifier for each of the cells, or else avoid using the dequeuing mechanism altogether. If you’re doing the latter, store a reference to each cell in a corresponding instance variable, or else add them all to a collection stored in an instance variable.
If you decide to go this route, you could do this one of two ways: either create the cells in Interface Builder (which would be handy, because they could already have the text fields nested inside them, nicely positioned, etc.) and connect them using outlets, or create the cells programmatically in
viewDidLoador in aninit...method.In either case, you would no longer need to call
dequeueReusableCellWithIdentifier:; instead you could just return the cell instances you’ve already created.