的UITabBarController setSelectedViewController:仅在标签

2019-10-20 22:20发布

我在这行获得在Xcode版本6崩溃

 -[UITabBarController setSelectedViewController:]
'NSInvalidArgumentException', reason: '-[UITabBarController setSelectedViewController:] only a view controller in the tab bar controller's list of view controllers can be selected.'

它在Xcode 5 self.selectedIndex是给垃圾值正常工作。

有没有人有一个想法如何解决这个问题。 该代码是最初写在Xcode 4.0

谢谢

Answer 1:

如果已使自定义标签栏然后删除要传递视图控制器的阵列的合成。 这为我工作。



文章来源: UITabBarController setSelectedViewController: only a view controller in the tab bar controller's list of view controllers can be selected