zhoudu
zhoudu

Reputation: 661

How can I get an event or notification after a NSWindow is closed?

How can I get an event or notification after a NSWindow is closed? The nearest thing that I can find is the windowWillClose: method in NSWindowDelegate. But this method is called when the NSWindow is about to close, not after it is closed. Should I just use this method? Is there a better way to do this?

Upvotes: 0

Views: 125

Answers (1)

Ken Thomases
Ken Thomases

Reputation: 90521

Yes, you should use either -windowWillClose: or the NSWindowWillCloseNotification. It's sent before the window is closed because the window object might be deallocated after it's closed and there would be no good way to refer to the window at that point. It shouldn't matter from your code's point of view, though.

Upvotes: 1

Related Questions