开发者

using tabBar Delegate methods from tabBarController

开发者 https://www.devze.com 2023-01-16 05:26 出处:网络
I have a tabBarController,I want to use the delegate method of tabBarDelegate not of the tabBarControllerDelegate.i.e; I want to use

I have a tabBarController,I want to use the delegate method of tabBarDelegate not of the tabBarControllerDelegate.i.e; I want to use

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item

I am doing this:

self.tabBarController.tabBar.delegate = self;

and then using the above method but the problem is that t开发者_Go百科he above method never get called.


According to the Apple document:

The tab bar view provided by this property is only for situations where you want to display an action sheet using the showFromTabBar: method of the UIActionSheet class.

So I guess you should use the controller's delegate instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号