Owner other than window controller in [NSWindowController initWithWindowNibName: owner]?

I would like to know how to initialize the window controller I am using

NSWindowController *c=[[NSWindowController alloc] initWithWindowNibName:@"Win" owner:myObj]

      

know which window it should control in the Win.xib file if myObj is not the controller itself? I used to set the window controller as owner so that I could set its window to IB with an exit. Is memory management the entire window controller, even if it's not the owner?

+3


source to share


1 answer


The window controller will manage the memory of top-level objects, even if it's not the owner. From the link NSWindowController

:

Regardless of who owns the files, the window controller is responsible for freeing all top-level objects in the nib file. cargo.

The window controller is usually the owner of the NIB, and usually it plugs into its window socket as it knows which window to control. You can also use a method -setWindow:

to set it explicitly.



It can be assumed that it NSWindowController

is looking for top-level NIB objects for the control window if the output is not connected, but I don't think it does.

Have you observed any behavior that you do not understand? What was it?

+1


source







All Articles