Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Both NSString and NSAttributedString have methods that cause them to be drawn onto a view. NSAttributedString has the following methods:
- (void)drawAtPoint:(NSPoint)aPoint
Draws the receiver. aPoint is the lower-left corner of the string.
- (void)drawInRect:(NSRect)rect
Draws the receiver; all drawing occurs inside rect. If rect is too small for the string to fit, the drawing is clipped to fit inside rect.
- (NSSize)size
Returns the size that the receiver would be if drawn.
NSString has analogous methods. With NSString, you need to supply a dictionary of attributes to be applied for the entire string.
- (void)drawAtPoint:(NSPoint)aPoint
withAttributes:(NSDictionary *)attribs
Draws the receiver with the attributes in attribs.