Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 413
Piscean Avatar asked Oct 06 '11 08:10

Piscean


1 Answers

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.

like image 108
rckoenes Avatar answered Oct 24 '22 03:10

rckoenes