drawRect:rect how to call this method , I am using to draw a string

Posted by user338322 on Stack Overflow See other posts from Stack Overflow or by user338322
Published on 2010-05-11T13:49:27Z Indexed on 2010/05/11 13:54 UTC
Read the original article Hit count: 203

Filed under:
-(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 kn ow how to call above method, i have paste above code in the implemntation file simply, but dont know why its not called when i execute the project, can some one

© Stack Overflow or respective owner

Related posts about iphone