I have a sheet that attaches to my main window. This is a login sheet that should not allow any interaction with the app until it is finished (modal as is the default). HOWEVER, I would like the user to be able to terminate the app. IE, they realize they need a login, give up and want to close the app. The default behavior is to play NSBeep and keep running. How can I override this?
Beginning with 10.6 you can control whether the modal sheet should prevent the application from terminating. This should do it:
[myModalSheet setPreventsApplicationTerminationWhenModal:NO];
It sounds like the root of the problem is that you're relying on the sheet to prevent interaction with the rest of the app. You're effectively storing application state information (logged in/not logged in) in a view, and that's not a good plan.
The sheet should allow the user to enter their login information, and the login sheet's controller should update the app's state as the info is entered. If you take this approach, the application won't allow the user to do anything that requires a login until the login process is actually complete, whether the sheet is there or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With