Suchi
Suchi

Reputation: 10039

iphone - How to call a function every time a tab is changed?

I am an iOS development newbie. I have a tab bar controller with an array of navigation controllers. I want a method to be called that invokes a webservice every time one of the tabs is clicked. I know I could assign a selector to a delegate for this purpose. I am just not sure about the syntax. Is this the right way to go about doing this?

Upvotes: 2

Views: 949

Answers (1)

Devang
Devang

Reputation: 11338

You may need to refer to UITabBarControllerDelegate Protocol Reference.

You can use tabBarController:didSelectViewController: delegate method.

Hope this helps.

Upvotes: 1

Related Questions