• 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 a progress bar from a code loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating a progress bar from a code loop


  • Subject: Re: Updating a progress bar from a code loop
  • From: j o a r <email@hidden>
  • Date: Mon, 9 Jun 2008 23:33:42 -0700


On Jun 9, 2008, at 11:24 PM, Graham Cox wrote:

I have a lengthy routine that I'd like to show a progress bar for. The routine runs in a while() loop, and calls a delegate which implements the progress update. My progress window opens OK but nothing gets updated, though I know that it's getting the correct values set.

I'm assuming the problem is that because I'm not running the event loop at this point, updates aren't getting processed. Makes sense I think.

How do I give some time to the event loop while I'm running my own loop? I tried:

[[NSRunLoop currentRunLoop] runMode:NSRunLoopCommonModes beforeDate: [NSDate distantFuture]];

but it didn't fix the problem. Note that I've tried running my window both modally and non-modally but it's the same either way.

What should I be doing?


See if you can make your lengthy routine thread safe, and if so, run it on a background thread.
You should put a lot of effort into always leaving the main thread open for user events.


j o a r


_______________________________________________

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 a progress bar from a code loop (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: JNI trouble
  • Next by Date: Re: Updating a progress bar from a code loop
  • Previous by thread: Updating a progress bar from a code loop
  • Next by thread: Re: Updating a progress bar from a code loop
  • Index(es):
    • Date
    • Thread