我有一个带有3个标签的TabBar应用程序,其中每个标签都是UINavigationController类。布局是:
-Tab1 - 类型为UINavigationController,它加载ViewController1
-Tab2 - 属于类型UINavigationController,它加载ViewController2
-Tab3 - 是类型UINavigationController,它加载ViewController3
前两个ViewControllers非常简单:
-ViewController1有自己的xib,其中包含加载(推送)其他视图的按钮
-ViewController2有自己的xib,其中包含加载(推送)其他视图的按钮
到目前为止一直很好 - 没有错误,运行得很好。
但是: -ViewController3加载另一个UINavigationController ,它加载自己的View-Controller--我们称之为ViewController4。 这实际上也很有效,但当你点击ViewController4中的任何按钮时 - 应用程序崩溃。
这是我得到的错误:
* 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:' - [homeVC directionsParkingButton:]:无法识别的选择器发送到实例0x4b5a9c0'
好像它不知道在哪里可以找到它的按钮所连接的xib - 或其他东西。
现在,我检查并确认这个特定的NavigationController没有任何问题:我创建了第4个选项卡并将其连接到此NavigationController - 一切正常:NavigationController加载ViewController4,它加载自己的xib包含成功导航的按钮你可以查看(和返回) - 所以那里的设置没有任何问题。
当NavigationController4加载到NavigationController3中时,事情就变坏了。我猜它与一个NavigationController在另一个内部的嵌套有关。 那么,我该如何解决这个问题呢?或者这种方法开始时是不是很糟糕?
任何提示都将不胜感激!
答案 0 :(得分:-1)
此博客指的是UINavigation Controller的嵌套。 Try out this blog...
更新 2013年1月
不幸的是,作者已删除了参考链接。