• 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: behind the scenes of -drawInRect:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: behind the scenes of -drawInRect:


  • Subject: Re: behind the scenes of -drawInRect:
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 26 May 2006 16:45:03 -0700


On May 26, 2006, at 4:35 PM, Joshua Scott Emmons wrote:

Ah. I was under the impression that -[NSAttributedString drawInRect:] was lighter weight. But now that you mention it, it makes sense that it would have to do all the things I'm doing with NSLayoutManager anyway just to wrap and layout the text in the given rect, wouldn't it? Is -drawInRect: just a convenience for setting up and tearing down NSLayoutManager et al. on the fly?


The string drawing methods like drawInRect: are intended primarily for convenience. However, they are not purely synonymous with setting up a layout manager, causing layout, and using it to draw; they have some optimized paths for particular situations, and they are often quite efficient. Nevertheless, if you already have a layout manager with the text laid out in it, then drawing with that layout manager should be at least as fast as using drawInRect: for any situation I can think of.


Douglas Davidson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >behind the scenes of -drawInRect: (From: Joshua Scott Emmons <email@hidden>)
 >Re: behind the scenes of -drawInRect: (From: Douglas Davidson <email@hidden>)
 >Re: behind the scenes of -drawInRect: (From: Joshua Scott Emmons <email@hidden>)
 >Re: behind the scenes of -drawInRect: (From: Aki Inoue <email@hidden>)
 >Re: behind the scenes of -drawInRect: (From: Joshua Scott Emmons <email@hidden>)

  • Prev by Date: Re: NSXLMDocument and malformed XML
  • Next by Date: Re: ssl.h linking error
  • Previous by thread: Re: behind the scenes of -drawInRect:
  • Next by thread: Re: behind the scenes of -drawInRect:
  • Index(es):
    • Date
    • Thread