Take the 2-minute tour ×

I have a custom view

MyView : UIViewController <UITableViewDelegate, UITableViewDataSource>

with a UITableView within (and some buttons and labels).

I have a notification from another view to populate the table with data form a sqlite3 database. I passed an array and after handle the notification I reload the table ([tableView reloadData]) with the new data (it has new data, I debug it).

Then it calls


but doesn't refresh cells, it still old data. I debug and it reloads but doesn't refresh data.

What's the problem? Can I clear old cells or something like that?

share|improve this question
What does your tableView:cellForRowAtIndexPath: method look like? Are you sure you're setting it every time, or just when the template cell (or whatever) is first created? –  Ian Henry Feb 17 '10 at 17:49
add comment

1 Answer

up vote 3 down vote accepted

It sounds like you're probably setting the data in your cell == nil block after dequeueing it. In that case, move it out of that block and be sure that the data is set on every single cellForRowAtIndexPath call.

share|improve this answer
Yes, that was the problem. Thank you ^^ –  emenegro Feb 25 '10 at 15:34
add comment

Your Answer


