Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should read about the Model-View-Controller (MVC) paradigm and how delegates fit into it. A good source would be Apple's document on the matter, as well as most beginning iPhone Development Books. I would suggest <a href="http://rads.stackoverflow.com/amzn/click/143023024X" rel="nofollow">this one</a>, and a good starting place for MVC is <a href="http://www.cocoalab.com/?q=node/24" rel="nofollow">here</a>. </p> <p>To answer your specific question, you want your <code>AppDelegate</code> to implement the <code>UITabBarControllerDelegate</code> protocol " when you want to augment the behavior of a tab bar. In particular, you can use it to determine whether specific tabs should be selected, to perform actions after a tab is selected, or to perform actions before or after the user customizes the order of the tabs. After implementing these methods in your custom object, you should then assign that object to the delegate property of the corresponding UITabBarController object." (From Apple's Class Document <a href="http://file:///Library/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_3.iOSLibrary.docset/Contents/Resources/Documents/index.html#documentation/UIKit/Reference/UITabBarControllerDelegate_Protocol/Reference/Reference.html" rel="nofollow">here</a>. </p> <p>In simplified terms, you use it when you want to do something custom/specific when a viewController is selected from the tab bar (<code>– tabBarController:didSelectViewController:)</code>or will be (<code>– tabBarController:shouldSelectViewController:)</code>. It can also be used to help with customizing the viewControllers showing on the tab bar if you have a need for more than allowed to be displayed at once (using a "More..." or whatever tab).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload