• 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: Prevent Asynchronous operation of beginSheetModalForWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prevent Asynchronous operation of beginSheetModalForWindow


  • Subject: Re: Prevent Asynchronous operation of beginSheetModalForWindow
  • From: "Michael Ash" <email@hidden>
  • Date: Tue, 10 Jun 2008 13:27:59 -0700

On Tue, Jun 10, 2008 at 1:10 PM, John Love <email@hidden> wrote:
> I have chosen the title "Prevent Asynchronous operation of
> beginSheetModalForWindow" because I use various calls to
> beginSheetModalForWindow in many parts of my app code and in one case I need
> the calls to didEndSelector to be completed *before* the code that follows
> beginSheetModalForWindow is executed (see MyDocument.m below).

I'm sorry to have to tell you this, but you are doomed.

Sheets are inherently asynchronous. To understand why, think about
what happens when two sheets are displayed on two different windows.
The user can dismiss them in any order. What happens if sheet A
displays, then sheet B displays, then the user goes back and closes
sheet B? If there were a synchronous API the code would have to
somehow jump down the stack to where you're waiting for A, while
somehow leaving the stuff that's waiting for B live farther up the
stack. This is quite simply impossible in a C-based language.

Is there some reason you can't just put all of the "after" code in the
endCalculateSheet: method?

Mike
_______________________________________________

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

  • Follow-Ups:
    • Re: Prevent Asynchronous operation of beginSheetModalForWindow
      • From: Jens Alfke <email@hidden>
References: 
 >Prevent Asynchronous operation of beginSheetModalForWindow (From: "John Love" <email@hidden>)

  • Prev by Date: Re: applicationWillTerminate and asynchronous orderly shutdown
  • Next by Date: re-factoring a category into a class instance
  • Previous by thread: Prevent Asynchronous operation of beginSheetModalForWindow
  • Next by thread: Re: Prevent Asynchronous operation of beginSheetModalForWindow
  • Index(es):
    • Date
    • Thread