• 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: updating NSView on separate thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: updating NSView on separate thread


  • Subject: Re: updating NSView on separate thread
  • From: Michael Ash <email@hidden>
  • Date: Mon, 1 Feb 2010 13:19:28 -0500

On Mon, Feb 1, 2010 at 10:20 AM, Kyle Sluder <email@hidden> wrote:
> Ooh. So you need to perform this operation synchronously but still pole the
> main thread (performing UI work is actually irrelevant; you need to run the
> runloop to avoid the spinning beachball anyway).
>
> So in your override of -writeToURL:…, spin off the background thread like I
> suggested, then set up your UI, and then start running the runloop in a
> special modal mode until your background thread is done.

Running the runloop is necessary but not sufficient to avoid a SPOD.
What you need to do to avoid that is to process events.

One solution to all these various problems is to put up a modal panel.
It processes events, thus avoiding the SPOD, it uses a special runloop
mode, avoiding recursive callouts, it gives you a place to put your
progress graphics, and it prevents the user from messing with the rest
of your app while all this is going on.

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

References: 
 >Re: updating NSView on separate thread (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Returning a nil float?
  • Next by Date: Core Data - Add an Entity to another Entity How?
  • Previous by thread: Re: updating NSView on separate thread
  • Next by thread: Re: updating NSView on separate thread
  • Index(es):
    • Date
    • Thread