Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does a UIViewController subclass know the its own filename?
    primarykey
    data
    text
    <p>Under the documentation for <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html" rel="nofollow">UIViewController -> nibName</a> property it says:</p> <blockquote> <p>This property contains the value specified at initialization time to the initWithNibName:bundle: method. The value of this property may be nil.</p> <p>If you use a nib file to store your view controller’s view, it is recommended that you specify that nib file explicitly when initializing your view controller. However, <strong>if you do not specify a nib name</strong>, and do not override the loadView method in your custom subclass, the view controller searches for a nib file using other means. Specifically, <strong>it looks for a nib file with an appropriate name</strong> (without the .nib extension) and loads that nib file whenever its view is requested. Specifically, it looks (in order) for a nib file with one of the following names:</p> <ol> <li>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.</li> <li><strong><em>It looks for a nib file whose name matches the name of the view controller class.</em></strong> For example, <strong>if the class name is MyViewController, it looks for a MyViewController.nib file.</strong></li> </ol> </blockquote> <p>My question is, how does the class know its own filename? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload