Invalidating UITableView contents
- by Roman
I have an application with several UITableViewControllers.
Now, the user is allowed to change "Data source". In that case I need to invalidate (reset) data in the relevant UITableViews.
I figured out, that I can use NSNotificationCenter and add these controllers as observers to events which will be generated when the data source changes.
The question is, how do I reset the underlying tables? I can, of course, set some boolean flag, and call UITableView:reloadData in viewWillAppear or viewDidAppear, but I was wondering, if there's a cleaner way of doing it.
Or perhaps I'm completely missing the point, and I don't need NSNotificationCenter altogether.
Thank you very much in advance.