gpt4 book ai didi

uitabbarcontroller - UITabBarDelegate 还是 UITabBarControllerDelegate?

转载 作者:行者123 更新时间:2023-12-04 07:57:47 25 4
gpt4 key购买 nike

每当用户触摸标签栏项目(即使它对应于当前显示的 View )时,我都需要收到一条消息。我不确定是否使用 UITabBarDelete 协议(protocol),该协议(protocol)提供:

- (void)tabBar:didSelectItem:

描述:

Sent to the delegate when the user selects a tab bar item.

或者,来自 UITabBarControllerDelegate:

- (void)tabBarController:didSelectViewController:

描述:

Tells the delegate that the user selected an item in the tab bar.

似乎可以使用任何一个。就我而言,我需要重新加载/重新初始化与真正的当前选项卡按钮关联的 View 。

感谢您的指导。

最佳答案

您可以使用任何一个。

在这种情况下:-(无效)tabBar:didSelectItem:您必须从 viewControllers 数组访问相应的 View Controller 。

然而,在这种情况下:-(无效)tabBarController:didSelectViewController:你会把它作为一个论点。

关于uitabbarcontroller - UITabBarDelegate 还是 UITabBarControllerDelegate?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11067013/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com