Search code examples
iphoneobjective-ciosuitabview

perform a method every time a tab is selected


I have tabview based project. how can I make a view connected to a tab perform a certain method every time the tab is selected?

Please help, Thanks


Solution

  • Assuming the tab var is the main way to make the view appear, you can hook code into:

    - (void)viewDidAppear:(BOOL)animated
    

    or ...

    - (void)viewWillAppear:(BOOL)animated