UIKit: view controllers loading nib files automatically

It seems like recently, view controllers have automatically downloaded a nib file with the exact name if it exists.

I can just initialize a view controller like

[[[ViewController alloc] init] autorelease] 

and then when he clicks on the navigation controller or, thus, it loads without me.

This works in my application, with the exception of one view controller, and I cannot understand why. All view controllers that load their feathers automatically were probably created in Xcode 4, while the only one where it doesn't work was propositionally created back in Xcode 3. Is there a hidden switch somewhere? I don’t want to find anything in the settings of the nib file, the nib itself and nothing in the source code of the view controllers that could explain it.

+4
source share
3 answers

iOS has a case-sensitive file system, so make sure this is the case.

Double check that the nip is turned on for the target you are building.

Make sure you do not have a loadView method.

Note the default processing for the nibName property .

+7
source

Also check to see if the user class that you are invoking init using init to do something other than calling itself with nil nibName.

0
source

Another thing is you should not override the UIViewController if you want to load the nib file automatically.

0
source

All Articles