我正在尝试在我的 CPView 中绘制一些文本,我有这个:
- (void)drawRect:(CGRect)aRect{
var ctx = [[CPGraphicsContext currentContext] graphicsPort],
viewBounds = [self bounds];
CGContextTranslateCTM(ctx, 0, viewBounds.size.height);
CGContextScaleCTM(ctx, 1, -1);
CGContextSetLineWidth(ctx, 2.0);
CGContextShowTextAtPoint(ctx, 100.0, 100.0, "SOME TEXT", 9);
}
但是,我在控制台中收到了这个错误: ReferenceError: Can't find variable: CGContextShowTextAtPoint
我该怎么做?