Stephane
Stephane

Reputation: 5078

Event when Tab Bar Item is selected

I've setup a Tab Bar with some tabs into my app. I've a view controller among other view controllers (managed by this TabBarController) who run some process when init method is called. And it seems the init method is triggerred one time so I don't know how to update the related view content. Any idea where (in which method) I can run this process?

Thx for helping,

Stephane

Upvotes: 0

Views: 2105

Answers (2)

EO2
EO2

Reputation: 364

- (void)viewWillAppear:(BOOL)animated { 
     [super viewWillAppear:animated];
     // ...
}

- (void)viewDidAppear:(BOOL)animated { 
     [super viewDidAppear:animated];
     // ...
}

Upvotes: 0

user387184
user387184

Reputation: 11053

To update the view every time it appears just use:

- (void)viewWillAppear:(BOOL)animated

When/how often exactly do you want update your view? Which elements?

Upvotes: 2

Related Questions