Invalidating UITableView contents

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-06-01T16:33:29Z Indexed on 2010/06/01 18:13 UTC
Read the original article Hit count: 186

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.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview