-(void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSelectFont(context, "Arial", 24, kCGEncodingFontSpecific);
CGContextSetTextPosition(context,80,80);
CGContextShowText(context, "hello", 6);
//not even this works
CGContextShowTextAtPoint(context, 1,1, "hello", 6);
}
I want to know how to call the above method, I have pasted the above code into the implementation file, but don’t know why it’s not called when I execute the project.
Does anyone know why this could be?
setNeedsDisplay should do that for you, here is a link link text
The methods is also called when the view first displays…