if you do not specify a nib name, and do not override the loadView
method in your custom subclass, the view controller searches for a nib file using other means. Specifically, it looks for a nib file with an appropriate name (without the .nib
extension)
If the view controller class name ends with the word ‘Controller’, as in MyViewController
, it looks for a nib file whose name matches the class name without the word ‘??Controller’, as in MyView.nib
.
It looks for a nib file whose name matches the name of the view controller class. For example, if the class name is MyViewController
, it looks for a MyViewController.nib
file.
原文:http://www.cnblogs.com/wangnan1979/p/4362361.html