• 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: CALayer -drawInContext and GCD
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CALayer -drawInContext and GCD


  • Subject: Re: CALayer -drawInContext and GCD
  • From: David Duncan <email@hidden>
  • Date: Thu, 2 Sep 2010 15:17:19 -0700

On Sep 2, 2010, at 11:29 AM, vincent habchi wrote:

> You mean I shall use your dispatch_async invocation instead of calling [layer setNeedsDisplay]?

Calling -setNeedsDisplay arranges for -display to later be called on the current runloop. As such using -setNeedsDisplay is reliant on a runloop running (and running regularly) neither of which you have on a GCD queue.

> I was thinking of calling dispatch_async () inside -drawInContext, but, if I understand your example correctly, this is wrong.

Doing so would cause you all manners of pain and suffering, the most common of which is things "mostly" working but occasionally your drawing going into the wrong view. Basically *never* use the context given to you in -drawInContext: outside of that invocation.
--
David Duncan

_______________________________________________

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: CALayer -drawInContext and GCD
      • From: Vincent Habchi <email@hidden>
    • Re: CALayer -drawInContext and GCD
      • From: "John C. Randolph" <email@hidden>
References: 
 >CALayer -drawInContext and GCD (From: Vincent Habchi <email@hidden>)
 >Re: CALayer -drawInContext and GCD (From: David Duncan <email@hidden>)
 >Re: CALayer -drawInContext and GCD (From: Chris Parker <email@hidden>)
 >Re: CALayer -drawInContext and GCD (From: David Duncan <email@hidden>)
 >Re: CALayer -drawInContext and GCD (From: vincent habchi <email@hidden>)

  • Prev by Date: UIView animation
  • Next by Date: Re: UIView animation
  • Previous by thread: Re: CALayer -drawInContext and GCD
  • Next by thread: Re: CALayer -drawInContext and GCD
  • Index(es):
    • Date
    • Thread