• 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 NSTextField before spinner animates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: updating NSTextField before spinner animates


  • Subject: Re: updating NSTextField before spinner animates
  • From: sqwarqDev <email@hidden>
  • Date: Wed, 12 Nov 2014 15:58:16 +0700

> On 11 Nov 2014, at 23:01, Fritz Anderson <email@hidden> wrote:

> -needsDisplay schedules a view’s -drawRect: for the next pass through the runloop. You’re putting your process to sleep at the OS level, so the runloop is suspended along with everything else.
>
> What you posted is evidently a minimal case, and maybe, instead of sleep(), your lengthy method is called instead. Same principle: Unless that method runs asynchronously (or simulates asynchrony by doing its work piecewise on an NSTimer, or by periodically sending -runMode:beforeDate: to the runloop), the runloop never has the chance to dispatch view updates.


Thanks for this Fritz. I think I get it. I need to get a clearer idea of how the run loop works. This isn't the first time I've been confused about why a line doesn't appear to return the result I expect before the next line executes. I suppose this is part of the difference between using traditonal procedural languages and these /new-fangled/ object-oriented ones... :~)

I guess I've got some reading up to do! Thanks again.



_______________________________________________

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


  • Follow-Ups:
    • Re: updating NSTextField before spinner animates
      • From: Graham Cox <email@hidden>
    • Re: updating NSTextField before spinner animates
      • From: Fritz Anderson <email@hidden>
References: 
 >updating NSTextField before spinner animates (From: sqwarqDev <email@hidden>)
 >Re: updating NSTextField before spinner animates (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: How to obtain paths of laid-out text [SOLVED]
  • Next by Date: CoreData regression or performance problem, anyone?
  • Previous by thread: Re: updating NSTextField before spinner animates
  • Next by thread: Re: updating NSTextField before spinner animates
  • Index(es):
    • Date
    • Thread