How to close a window (unload NIB)?

I have a custom subclass NSWindowControllerthat loads a NIB file during initialization as follows:

self = [super initWithNibNamed:@"myNib"];
if (self != nil) {
    [self window];
}

The tip contains some user views and some other controls. NSWindowControlleris the owner of the file, and at least one of them even binds to it.

Just what do I need to do to close and let go of this window? I spend all day trying to figure it out, and I still don't know.

+3
source share
2 answers

; "loading" unarchiving , . , ; . , , , .

, :

, close.

. " " ( , ).

+6

@peter hosey.

[self close]; // will work only if your nib is wired up correctly.

. "Referencing Outlet" "Owner Files" "Window". .

+13

Source: https://habr.com/ru/post/1741340/


All Articles