All OS X application that support NSWindowRestoration can be closed by selecting the menu entry "Quit and Close All Windows" (Option-Command Q). This disables the state restoration and the next time you open the app all windows will be in their default position.
The menu entry triggers the terminate: method on NSApplication. But so does the regular "Close App" menu as well (Command Q).
How can I do the "Quit and Close All Windows" programmatically? Do I really have to close all windows by myself and then call terminate:?
How does Apple magically decide what to do, when both actions are connected to the same terminate: method?