Alex Rivera | Logout

How can i refresh a view every time when a tab bar item is clicked?

Asked 2011-10-06T08:41:19.967
11

I am making an application with TabBar. But TabBarController is not RootViewController. In the Tab Bar there are 4 tabs. One of those tabs is history which is linked with a table view which shows history. I want to refresh that view every time when i click that so that i can get updated tableview. How can i do that? Thanks in advance.

Edit
Report

1 Answer

8

use - (void) viewWillAppear:(BOOL)animated to update any content in your view.

- (void) viewWillAppear:(BOOL)animated {
   [super viewWillAppear:animated];
   // You code here to update the view.
}

This method will be called every time the view is about to be displayed.

answered 2011-10-06T09:07:25.997

Your Answer