gpt4 book ai didi

iphone - 获取 NavigationController Stack of tabbarItem in a tabbarController

转载 作者:行者123 更新时间:2023-11-28 22:46:13 24 4
gpt4 key购买 nike

我想获取 UIViewControllers 的列表,即 UINavigationController 堆栈在 UITabBarController 中 tabbaritem 的特定索引处。请详细说明..!请小伙伴们手拉手

最佳答案

这样做:

NSArray *arrControllers = self.tabBarController.viewControllers;
for(UIViewController *viewController in arrControllers)
{
if([viewController isKIndOfClass:[UINavigationController class]])
{
//NavigationController
UINavigationController *navCtrl = (UINavigationController *)viewController;
NSLog(@"%@",navCtrl.viewControllers);
}
else
{
// view controller
}
}

关于iphone - 获取 NavigationController Stack of tabbarItem in a tabbarController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13177275/

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