• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Modal-loop Event-handling question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Modal-loop Event-handling question (From: Motti Shneor <email@hidden>)

  • Prev by Date: No validation with a bound NSTableView and custom NSFormatter
  • Next by Date: Re: Minimal document-based app
  • Previous by thread: Re: Modal-loop Event-handling question
  • Next by thread: No validation with a bound NSTableView and custom NSFormatter
  • Index(es):
    • Date
    • Thread