본문 바로가기

개발관련/Mac

window close 관련 notification

// close button click event ( red button )

1. change protocol to NSWindowDelegate

// 사용시 delegate 를 등록 해야 함
2. [window setDelegate:self];

- (void) windowWillClose:(NSNotification *)aNotification; 

- (void) applicationWillTerminate:(NSNotification *)aNotification;
- (BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender;

참조
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSApplicationDelegate_Protocol/Reference/Reference.html