Our app has a UITableViewController with some custom section headers.
These section headers are implemented using a UIViewController and a Xib file which contains various labels and graphics.
A server call is made to retrieve dynamic data from the server and once retrieved the section header ViewControllers are created in a NSMutableArray and then in - (UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section method I return the controller.view for the appropriate section. The callback which handles the receipt of the server side content calls [self.tableView reloadData] to display the data.
This all worked fine prior to iOS5. But since iOS5 the table loads the sections but they appear blank (as the are defined in the Xib) without the specific data. Only when you manually scroll the table and the sections are forced to redraw, is the data populated in the section header Views.
I have tried lots of techniques to get this to work. The only hack that got close was to put in a NSTimer which called the [self.tableView reloadData] after 0.5 seconds. This unreliably works but there is a flash and also if there are many sections those off the screen initially scroll in blank until they are forced to refresh.
I was wondering if my technique of sending in a viewController view for a section header was flawed or I need to explicitly need to ask it to redraw. I used a viewController because the Xib is easier to layout the complex view.
Other thought was whether the callback from the server was not properly calling the reloadData. I am using ASIHTTP package and the delegate callback.
Any help much appreciated
May be the reloading is happening from some background thread. Try: