UITableView reloadData not working!
For all of you people that are having this problem (as I was just experiencing) check a few things before submitting a bug report to Apple:
- If you are using Interface Builder to set up your custom UITableView (without using a UITableViewController), then check that your IBOutlets are set up properly for UITableView’s properties: delegate and dataSource. If they are nil then your reloadData call will not work. Then again, your entire table won’t work, so it’s pretty clear if you haven’t set them.
- If you have subclassed UITableViewController to run your custom processes and show your custom design, then make sure you have not set the tableView property. If you have, it will override UITableViewController’s original tableView property and will ruin your application (and will most likely crash it).
- You must call reloadData on the main thread. This was my problem. If you are doing the sensible thing and downloading some data on a separate thread, and then passing it back through delegate methods or a notification center to your custom UITableViewController, make sure that you call reloadData back on the main thread. If you’re having trouble with this, use this or similar code:
[[self tableView] performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
Hopefully this cures some headaches.

Trackbacks & Pingbacks