views:

154

answers:

1

Hi.

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

(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;

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?

+1  A: 

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.

greenisus
Yes, that was the problem. Thank you ^^
Espuz