【发布时间】:2012-10-19 14:51:03
【问题描述】:
大家好,我想在相关的UIViewControllers 中获取我的UITabbarController 的选定索引。
我试图用[self parentViewController]; 获得parentViewController 但似乎,这不是正确的方法,因为我得到的控制器没有像selectedIndex 这样的方法。有什么建议吗?
【问题讨论】:
-
我找到了解决方案:NSInteger selectedIndex = self.tabBarController.selectedIndex;
标签: iphone objective-c xcode macos cocoa