简体   繁体   中英

IOS6 UITabBarController didSelectViewController Event

I have created an application with the 'Tabbed Application' template. As usual, 2 tabs are created by default and linked to the firstViewController and secondViewController.

May I know how to get the didSelectViewController event with the 'Tabbed Application' template so that I can implement something when the first tab is clicked?

I have tried many solutions online but it seems that they are not for the 'Tabbed Application' template.

Thanks very much for your help.

if you've created "Tabbed Application" template then in your AppDelegate.m file there must be

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController

this method in comment at the end side of that file so just uncomment that method and use this and if not provided then use this method to achive your desired output and make sure there is a tab delegate in AppDelegate.h file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM