views:

42

answers:

1

I'm trying to get my UITableView to show cells with images placed on them (contained in a UIImageView overlaid). I'm wondering why when scrolling up and down, the images look like they're overlaid on top of one another.

What can I do in this case for the sake of memory management as well as to fix this issue?

alt text

+3  A: 

Make sure that when you're dequeuing a reusable cell that you remove whatever image view was in the cell before you add the one for the current index path.

Alternatively, you can change the image property of the UIImageView.

Frank Schmitt
This is the correct answer. You're using the default "cell" reuse ID for everything and not clearing out the previous contents. (Pass `nil` for the ID to verify that this is the problem, then fix it for real for good perf)
quixoto