iphone - Reloading Data in a UITableView when pressing a UITabBarItem -
I have run into a UITabBarController my app delegate and when the user touches a specific tab I want to mesh (Favorites) and table within it to reload the forced data. What is the best practice in this example? I have my app delegate added UITabBarDelegate protocol is implemented didSelectViewController method. So far, so good. Within the method I get a ViewController, then I can choose which tab to set about checking the title, etc. I can send a message reloadData to UITableView in ViewController? I tried to make a method in my favorite visual controller class and said that but it does not work. Example code:
#pragma mark UITabBarController delegate methods - (void) TabBarController: (UITabBarController *) TabBarController didSelectViewController: (UIViewController *) ViewController {// Favorites tab If pressed, then (viewController.title = @ "favorites") {reloads the data, then ([ViewController respondsToSelector: @selector (reloadFavourites :)) {[ViewController reloadFavourites]; }}}}
It looks like you have a [UITableView reloadData]
table ViewController the View WillDisplay
This method will be reloaded each time the table is displayed.
If you want to force a reload, the tableview will be displayed in advance, then the OP You should work with reloading the method created in
Comments
Post a Comment