【发布时间】:2011-05-01 20:42:12
【问题描述】:
我正在使用以下策略构建一个基于窗口(所有 UI 以编程方式连接,没有 IB)的 MonoTouch 应用程序:
伪代码:
Note: I'm not calling base.ViewDidLoad on any of the ViewDidLoad calls,
nor calling any base constructors of any ViewController
subclass I've implemented.
AppDelegate : UIApplicationDelegate
FinishedLaunching()
window.AddSubView(tabbarController.View)
TabbarController : UITabbarController
ViewDidLoad()
ViewControllers[0] = myNavigationController
MyNavigationController : UINavigationController
ViewDidLoad()
PushViewController(myTableViewController,false)
MyTableViewController : UITableViewController
ViewDidLoad()
//Property NavigationController is NULL.
根据 developer.apple.com,应该使用名为 initWithRootController 的 ObjC 初始化方法创建 NavigationControllers,但我找不到任何相当于这样做的 MonoTouch。
MyNavigationControllers PushViewController 方法不应该自动分配 MyTableViewController 实例的 NavigationController 属性吗? 要让这个自动装配继续进行,我可能会缺少什么吗?
其他一切都按预期工作。非常感谢MT团队! :)
谢谢!
【问题讨论】:
标签: ios uinavigationcontroller xamarin.ios