开发者

iPhone Dev - Where is RootViewController instantiated in a Navigation-based application?

开发者 https://www.devze.com 2023-03-21 05:26 出处:网络
I can\'t seem to find where it\'s actually instantiated. I looked in the myProjAppDelegate.m and saw this:

I can't seem to find where it's actually instantiated. I looked in the myProjAppDelegate.m and saw this:

self.window.rootViewController = self.开发者_如何学JAVAnavigationController;

But it says that the window's rootViewController property is really just a UIViewController, not a UITableViewController, which is what the RootViewController.m class is a subclass of. I wrote a custom method in my RootViewController.m and tried to call it on self.navigationController in myProjAppDelegate.m and got a SIGABRT, so it seems like this is not it. Can anyone help me out?


It's not visible in code. Your MainWindow.xib contains a Window and a Navigation Controller which are connected via outlets to your AppDelegate. Both the Window and the Navigation Controller get instantiated when the application loads the .xib files. Inside the Window (in the MainWindow.xib) is a RootViewController, that is the RootViewController you are talking about.

Regarding the class, UITableViewController inherits from UIViewController.

0

精彩评论

暂无评论...
验证码 换一张
取 消