我想调用一个方法负责每隔5秒后在屏幕上绘制文本。这里是我的代码CGContextShowTextAtPoint:无效的上下文
-(void) handleTimer: (NSTimer *)timer
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 2.0);
CGContextSetStrokeColorWithColor(context, currentColor.CGColor);
CGContextTranslateCTM(context, 145.0, 240.0);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextSelectFont(context, "Arial", 18, kCGEncodingMacRoman);
CGContextSetCharacterSpacing(context, 1);
CGContextSetTextDrawingMode(context, kCGTextFillStroke);
CGContextSetRGBStrokeColor(context, 0.5,0.5,1,1);
CGContextShowTextAtPoint(context, 100, 100, "01", 2);
}
但在5秒的时候,这种方法被称为我收到此错误
CGContextShowTextAtPoint后:无效的情况下
的另一件事是如何显示更薄的字体?
如何格式化代码,使其在stackoverflow中看起来很完美? – coure2011 2010-05-26 18:31:00