What problems can lead to disabling the owner of the nib file?

If I can load an object from a nib file without using a file owner, then what is the reason for the file owner to exist? In addition, output connections can be created without using the file owner. For example, I can make connections directly from the object to the tip. So again, I really can’t understand the need for a file owner. Does this relate to the MVC pattern? Should the file owner be of type UIViewController?

+5
source share
1 answer

When the Cocoa nib file is loaded, each object serialized in the nib file is created. Then, for each connection in the nib file, it calls setValue:forKey:on the target to create the connection. Some connections relate to the object nil. These messages are setValue:forKey:sent to any object passed as the owner of the file.

If you do not have a file owner, connections nilwill be ignored. If you do not have connections nil, then this is no different from the lack of a file owner. This is not particularly common.

All this allows you to create instances of several instances of the same nib file files, transferring other file owners to the download process.


EDIT:

, nib - . initWithNibName:bundle:, nib. nib . UINib . , nib nil, UINib ( ).

, . nib, .

+4

All Articles