Modal Alert Sheet
Modal Alert Sheet
- Subject: Modal Alert Sheet
- From: Jim Elliott <email@hidden>
- Date: Sat, 05 Oct 2013 13:28:42 +0200
An odd thing is happening when I invoke the NSAlert method beginSheetModelForWindow:modalDelegate:didEndSelector:conextInfo. It seems that the method returns before calling and returning from the didEndSelector.
To be more specific, I have subclassed the NSDocument method canCloseDocument: because I have some additional cleanup to do before the document window goes away. If the cleanup is needed, I create an alert sheet and asks the user if he wants the cleanup performed. After calling beginSheetModalWithWindow, I then invoke canCloseDocument on super.
The program runs and displays the alert sheet, but before the user can click in the alert sheet, the document is closed and the window taken down. If I use runModal instead of beginSheetModalForWindow, the program performs correctly, but I would really like to have the alert sheet tacked to the window, the way beginSheetModalForWindow does it. Can anyone help?
-- jim elliott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden