문제

I need to close the entire app when the user click on a Panel close button, I tried:

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication {
    return YES;
}

but it closes the app also from file-selector panels.

Thank you in advance. L.

도움이 되었습니까?

해결책

Applications can't be closed, only quit. Only windows can be closed, not applications.

If you want to quit the application when only a specific window is closed, be that window's delegate and respond to the windowWillClose: message by telling the application to terminate.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top