• 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: Jens Alfke <email@hidden>
  • Date: Tue, 10 Jun 2008 15:46:58 -0700


On 10 Jun '08, at 1:27 PM, Michael Ash wrote:

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.

It's not impossible, but it would require either that every window ran in a separate thread (as in the BeOS) or that the Cocoa frameworks supported coroutines. Coroutines are quite feasible in C, using setjmp/ longjmp style trickery; but when I investigated this I saw that using them would probably seriously confuse Objective-C's exception handling, and possibly NSRunLoop too.


John, you should look at the Cocoa conceptual docs that describe the use of sheets. There are probably a bunch of examples of sheet usage in the sample code too, if you search for "beginSheetModalForWindow:".

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: 
 >Prevent Asynchronous operation of beginSheetModalForWindow (From: "John Love" <email@hidden>)
 >Re: Prevent Asynchronous operation of beginSheetModalForWindow (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: re-factoring a category into a class instance
  • Next by Date: launching standard apps with NSTask
  • Previous by thread: Re: Prevent Asynchronous operation of beginSheetModalForWindow
  • Next by thread: Re: Prevent Asynchronous operation of beginSheetModalForWindow
  • Index(es):
    • Date
    • Thread