views:

43

answers:

1

I'm just starting out with iOS programming. I'm wondering why view is an outlet on UIViewController. When I look at UIViewController.h, the keyword IBOutlet isn't present. I thought all outlets available in Interface Builder had to be declared as IBOutlet. Am I missing something here?

A: 

For certain classes IB has some builtin magic, like the navigation item on the UINavigationController and such, which you don't have to add yourself.

One of those things is that every View Controller always has a view outlet, which by definition makes sense. IB doesn't need to look at a header file to know that, it's built-in, apparently, or put in some other place than headers we don't know about (but that could also be a definition of built-in). This is probably also related to the fact that if you drag a view into a view controller, IB sizes it and hooks it up to the view outlet automagically.

mvds