【发布时间】:2011-09-26 09:38:38
【问题描述】:
我正在使用的自定义标签栏控制器应用 ViewController 或 UINavigationController,如下所示:UIViewController* viewController = [data objectForKey:@"viewController"];
我不知道它是如何工作的,但“viewController”作为 UINavigationController 出现。接下来,自定义标签栏控制器类添加一个像这样的标签,viewController.view.tag = THE_TAG;
检索控制器是使用UIView* currentView = [self.window viewWithTag:SELECTED_VIEW_CONTROLLER_TAG];
这部分是我感到困惑的地方,因为现在当我 nslog 时 “currentView”我得到一个 UILayout 等......而不是我的 UINavigationController。我假设它将标签应用于包含导航控制器的 UIView?
如何在这个 UIView 中引用 UINavigationController?
【问题讨论】:
-
在我看来,如果
UIView需要联系任何类型的UIViewController,这是一个糟糕的设计。应该反过来,或者让他们通过协议进行交谈。
标签: iphone ios cocoa-touch