开发者

naming conventions - uinavigationcontroller and root view

This may be the silliest question i have ever asked here, but i just can't seem to understand this. I am new to xcode and iOS development, and these days trying to learn how uinavigtioncontroller works. In all the examples and tutorials that i see (none of which could help me btw...maybe b/c of the new xcode?), there is always a mention of a RootViewController class. Now, when I open a new view based app project, i immediately get the app delegate class and another object called: MyProjectViewController. So my question is - is this RootViewController that everyone are talking about IS the MyProjectViewController that 开发者_开发知识库is created for me automatically? OR do they open a new class and call it RootViewController? OR do they just change its name from MyProjectViewController to RootViewController? (or something else...:))

Thanks for the help!


There is nothing special with RootViewController. It is just another view controller. You can have your own e.g. MyTopViewController as your root view controller.

When you use a navigation controller, you navigate through many view controller. The fist one in the stack, where you start to navigate is called root view controller. But RootViewController is just a class name.

Usually, when you create a project, if you open the MainWindow.xib, you can find all the reference to the default created file. Even you can change the name of MainWindow.xib.

If you open the {Project-Name}-Info.plist file, in your project, you can find an option for main xib file, which refers to the MainWindow.xib file. Here you can customize which is the one xib file you want to load at first runtime.


In xcode 4 - when you create a navigation controller project you get a RootViewController class .h/.m/.xib created for you.

You can add these to the basic project type, but that is what the tutorials are referring to.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜