InitWithNib against setting file owner to view subclasses of a subclass

I do not understand the role of nib files and sets the file owner to a subclass of viewcontroller. If I set the owner of the nib file for my subclass, then when I instantiate the subclass, nib seems to load with all its subzones. Why do I need initWithNib?

In another case, I noticed that when I created a table view inside nib, added a search bar to tableview and set the file owner to a subclass of uitableviewcontroller, the search bar would not appear if I had not used initWithNib. Why do I need initWithNib in this case, if I have not been to the previous one?

+3
source share
2 answers

It’s hard for me to understand your question.

-initWithNibName: bundle: UIViewController. nil nib, , , .xib , . .xib . , . , , , - , .

- nib, - , nib. ( ) , Interface Builder , , , , , - File Owner. , , , , , . , nib .

, File Owner -initWithNibName: bundle: , . -init , nib , , -init -initWithNibName: bundle: nil , .

+4

, nib. - , . , , initWithNib .

0

All Articles