- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{ // 這里不需要調(diào)用super,因?yàn)楦割悰]有實(shí)現(xiàn)這個代理方法
// 調(diào)用了會報錯,同時說明UITabBarController沒有通過這個方法監(jiān)聽tabbar點(diǎn)擊
[super tabBar:tabBar didSelectItem:item];
}
細(xì)節(jié):
Changing the delegate of 【a tab bar managed by a tab bar controller】 is not allowed.
被UITabBarController所管理的UITabBar,它的delegate不允許被修改
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
NSLog(@"%s", __func__);
}