• 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: Jens Alfke <email@hidden>
  • Date: Sun, 31 Jan 2010 21:44:19 -0800

On Jan 31, 2010, at 9:13 PM, Patrick Cusack wrote:

> What I want to do is this: display a spinning icon in a transparent overlay window (I can do this no problem) while my program is saving, printing PDFs, etc. These methods as typically defined in NSDocument do not have areas where you can inject a call to update a progress bar. I'm thinking about - (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError . I want to draw a circular-spinning-progress-ish indicator on a transparent window so that the user understands why the UI is temporarily locked when these methods are being called. Am I fitting a round peg in a square whole?

Yes :). If there's an operation that blocks for a long time, you should run it on a background thread so the UI remains responsive, instead of running it on the main thread and trying to update the UI in the background. Look into using NSOperation (or dispatch queues on 10.6).

—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: 
 >updating NSView on separate thread (From: email@hidden)
 >Re: updating NSView on separate thread (From: Kyle Sluder <email@hidden>)
 >Re: updating NSView on separate thread (From: Patrick Cusack <email@hidden>)
 >Re: updating NSView on separate thread (From: Patrick Cusack <email@hidden>)

  • Prev by Date: Re: WebView Loading Images from Local Filesystem
  • Next by Date: Re: OpenAL and file size
  • Previous by thread: Re: updating NSView on separate thread
  • Next by thread: NSProgressIndicator Stuck after unhiding + other triggers. Demo App.
  • Index(es):
    • Date
    • Thread