Vladimir "Dair" Lebedev-Schmidthof (dair_spb) wrote,
Vladimir "Dair" Lebedev-Schmidthof


Кусок из доки по Маку, курсив мой.

Drawing With Colors

  • While it's normally spoken of as an Object Oriented approach, Cocoa is occasionally a little bit Magic Oriented (Mystery Oriented?). You would think that if you're drawing in an NSView (or a subclass of NSView) that the color would be set via an NSView method (or maybe a method of the line or shape you're drawing). Instead, you send a set message to an NSColor object which, typically, isn't created or referenced until right before drawing in the view. It's common to find lines of code like [[NSColor redColor] set]; in a method that draws in a view. Such lines automagically tell the view which color to use in subsequent drawing instructions.

Найдено коллегой тут.

p.s. завёл новый юзерпик по этому поводу :-)
Tags: computer, work

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded