What is the need for a file owner in xcode xib files? Can I do the same without a file owner?

Why should I set the class identifier of the file owner, and not the class identifier of my user object, which is shown in nib, and make connections from it? What happens if I set the file owner to zero? For me, everything works fine with the owner of the nil file, so what is respect for doing communication with him?

+5
source share
3 answers

NIB is an archived graph of objects. You can download it, and this graph of objects will be restored. The thing is, you usually want / need a recently downloaded object schedule that will be connected to an existing object schedule for your program. You do not want him to stand apart, disconnected from everything else.

, . - -, NIB. . - File Owner. - - , NIB, NIB. NIB, , , NIB, NIB. NIB. , NIB .

MainMenu NIB . Cocoa, , ( , ). NIB , . , , NIB . ( , NSArrayController, .) , , NIB.

, NSWindowController . NIB. - , , - NIB. NIB. NIB.

File Owner nil, a) , , NIB , b) NIB.

+8

- , IBOutlets IBActions . , "ViewController" IBOutlet UIButton *button -(IBAction)changeViewWhenButtonPressed: (id) sender, - "ViewController" .

, Class Identity .

, :

iPhone SDK - xCode?

+5

" " - , nib nib, . ( , .) , .

Application. , , , , " " , . .

If you have a window or poster or something else, often the owner of the file is the object that is being viewed, and therefore it is useful to be able to attach ui to it. You can load the same thread many times, each of which “belongs” to another instance of this class - another document or a verified object or something else.

(Essentially, a file owner is any object passed to the "owner:" parameter in the nib load method.)

+3
source

All Articles