title: How do you draw text in a custom view using Objective-C?
body: <p>I've figured out how to use the NSBezierPath class to draw shapes in the drawRect function of my custom view class, however I can't seem to figure out how to draw text. The following code is what I have so far for drawing the text (located in the drawRect function):</p>
  
  <pre><code>NSText *text = [NSText new];
  [text setTextColor: [NSColor yellowColor]];
  [text setText: @"Hello!"];
  </code></pre>
  
  <p>I'm guessing that I may need to supply an NSRect or NSPoint to tell the NSText object where to draw itself, but I can't find anything in the Cocoa documentation about how to do this. </p>