UIViewController should be initialized using initWithNibName:bundle:
method. In its description stated:
This is the designated initializer for this class.
If you specify nil for the nibName parameter and do not override the loadView method in your custom subclass, the default view controller behavior is to look for a nib file whose name (without the .nib extension) matches the name of your view controller class. If it finds one, the class name becomes the value of the nibName property, which results in the corresponding nib file being associated with this view controller.
So if you do not load you view controller from nib file make sure you override loadView
method and set controller's view
property in it.
Hope that will help.