views:

378

answers:

1

Hi all,

I'm new to iphone and experimenting with the platform. I have a root view controller which loads it's view from a nib. I accidentally uncommented the 'loadView' method in this class, and now the app crashes - is this because if a view controller is initiated from a nib then you can never have a loadView implementation?

Taras

+3  A: 

If you create your view using a nib file then you should override viewDidLoad and add your subviews there. You only want to override loadView when you are creating all your views programatically.

Here's a link to the UIViewController documentation which has a little bit longer explanation under the entries for loadView and viewDidLoad.

I was confused by the same issue at first...

Jonathan Arbogast