0

To establish some context : I have a UITableView with n cells.
When the user selects a cell they the cell expands and the user experience then continues within that cell. There are some animations that take place within the cell.

- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
{
     //expand cell/increase cell height animated
     //add a button to bottom of cell with target(didpressbutton:)
}

- (void)didpressbutton:(id)sender
{
     //perform complex animating rearranging UI elements
}

At the end of the flow the user needs to comeback to the original tableview.

But the cell with the misaligned UI elements are still showing as it is dequeuing the old cells.
Is there any way for me to clear the cached cell or reinitialise them?

Aatish Molasi
  • 2,138
  • 3
  • 20
  • 43
  • "the user experience then continues within that cell" how does that work ? Can you post some code ? – Petar Jul 03 '15 at 10:16
  • How about not using dequeueReusableCellWithReuseIdentifier method in cellforRowAtIndexPath? But it contains memory problem,meybe. – merge Jul 03 '15 at 10:22

1 Answers1

0

But the cell with the misaligned UI elements are still showing as it is dequeuing the old cells. Is there any way for me to clear the cached cell or reinitialise them?

You are obviously misusing -prepareForReuse:. Implement this method to reset any state the cells have.

Christian Schnorr
  • 10,768
  • 8
  • 48
  • 83