Our OS X application shows modal forms at times, and one of the downsides of modal forms is that menu items don’t work when you have a modal form visible. You can click the menu item as normal, but no selectors are called on the target.
This is bad because even if there’s a modal form showing, we want the user to be able to command-q to quit the app, as is normal for apps on on OS X.
However, there is an undocumented method _blocksActionWhenModal that returns YES by default. If you override it to return NO, your menu items start working normally on modal forms, which means everything can be handled properly.
I’d like to find an alternative to this, as I’d prefer not to use an undocumented method like this (as Apple could change it with a new OS release). Is there another way of achieving the same result here? “Not using modal forms” isn’t really an option.
For 10.6+, use
[NSWindow setPreventsApplicationTerminationWhenModal:]on the modal window to allow Quit.