Re: Modal-loop Event-handling question
Re: Modal-loop Event-handling question
- Subject: Re: Modal-loop Event-handling question
- From: Jens Alfke <email@hidden>
- Date: Tue, 01 May 2012 14:35:39 -0700
On May 1, 2012, at 12:30 PM, Motti Shneor wrote:
> To avoid the crash, we tried to defer the "endSheet" via "performSelecor:@selector(closeAnyOpenSheet) afterDelay:0.0". This prevents the releasing of the dialog before the "mouseUp" event is received. However, when "mouseUp" event comes, the didEndSelector is called for the sheet-alert (before our deferred "endSheet" has a chance to happen), and then we face another problem --- we try to accomplish user command, in a dead context.
There are always going to be race conditions like this — the user can always press a button at exactly the same time something asynchronously makes the button meaningless. Your code just has to deal with it safely. Presumably something underneath will return a kSessionClosedError, and the UI code will just ignore it because the sheet’s gone already.
—Jens
_______________________________________________
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