On Mon, Feb 1, 2010 at 10:20 AM, Kyle Sluder <kyle.slu...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to