tags:

views:

87

answers:

3

How can I draw a text in drawRect? Thanks in advance

+2  A: 

The NSString class has several methods for drawing itself. Look in the docs for NSString(UIStringDrawing).

Jongsma
A: 

You can also look at the CoreGraphics functions for doing this, though, Jongsma's method tends to be a little easier to use. Look at the apple docs for the NSString UIKit additions.

pzearfoss
+1  A: 

Example:

NSString *test = [[NSString alloc] initWithString:@"test"];
[test drawAtPoint:CGPointMake(200,200) withFont:[UIFont fontWithName:@"Helvetica" size:23 ]];
Jordan