UITableView does not actually reload data, even if data source methods return new data

I have a tableview controller where the data for this table comes from HTTP requests. When new data appears (which should appear as new rows in my table), but when I call

[self.tableView reloadData]

nothing changes in the table. No new lines! I have log statements in my data source methods that confirm that after calling reloadData, the table asks how many rows and sections to draw. My controller will certainly return a new number of rows as it should, but the table does not seem to care. I also verified that my cellForRow method ... returned the correct instance of the cell that was configured with the corresponding data object. I have never had this problem before!

I am running iOS 4.2 in a simulator with an iPad application created for 4.2.

+5
source share
3 answers

Perhaps you can have multiple tables? You can print table pointers from didSelectRowAtIndexPath: and cellForRowAtIndexPath: delegate methods. Including a description of your self.tableView can also highlight the problem.

+1
source

Sounds like a confusion of the old model / view. reloadData will simply redisplay the data that is already in the data source, rather than loading new data. You may call

[yourFetchedResultsController performFetch:&*error];

, , . , NSFetchedResultsController , , . NSFetchedResultsController:

, NSFetchedResultsController :

, (. " " ). , , (. ").

, , , .

  • : . , , fetch .

  • : non-nil . .

  • : . . .

+1

Are your line heights> 0.0? What returns tableView.visibleCells? I would confirm that my cells have hidden != YESand that frame.size> (0x0)

0
source

All Articles