I have created a subclass of UITableViewController that is used as the custom class for a View in my storyboard. The view has a number of sections/rows defined as prototype cells which are instantiated and shown as expected. Most of the UITableView delegate methods simply call the super’s methods that handle section amount, rows, etc.
I have cached content that is used to update the cells on -viewDidLoad and then an asynchronous operation that reloads the content from my server and rebinds the data afterwards (on the main thread, -performSelectorOnMainThread::). It is at this point that, seemingly arbitrarily, some of the cells content (labels primarily) will be cleared of data and not updated to the new data for anywhere between 10-15 seconds. At which point either the content which just show up or sometimes scrolling in the table view will cause the content to appear.
I know the selector is being called and on the main thread, the UI element’s text properties are getting set but randomly they just…don’t update. I’ve tried adding in -setNeedsDisplay on the tableView, controller’s view and -reloadData on the tableView (though the last one seemed unnecessary as they’re prototype cells) all to no avail.
Anyone come across this?
My comment did indeed fix my problem. It seems
UILabel‘s are not updated when modified but rather it’s decided internally when to repaint them – regardless if you try to force it withdisplayor setNeedsDisplay.Solution: Use a
UITextViewinstead of aUILabel