No se puede dibujar en el drawRect de UITableViewCell
Tengo problemas para dibujar en el método drawRect de mi UITableViewCell personalizado. Aquí está el código que estoy usando
- (void)drawRect:(CGRect)rect
{
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGPoint origin = _faceView.frame.origin;
CGFloat width = _faceView.frame.size.width;
CGFloat height = _faceView.frame.size.height;
CGFloat border = 2.0f;
CGPoint startPt = CGPointMake(origin.x + width/2, self.frame.size.height);
CGContextBeginPath(ctx);
CGContextMoveToPoint(ctx, startPt.x, startPt.y);
CGPoint basePt = CGPointMake(startPt.x, origin.y - height - border);
CGContextAddLineToPoint(ctx, basePt.x, basePt.y);
CGRect circleRect = CGRectMake(origin.x - border, origin.y - border, width + 2 * border, height + 2 * border);
CGContextAddEllipseInRect(ctx, circleRect);
UIColor *color = [UIColor redColor];
CGContextSetFillColorWithColor(ctx, color.CGColor);
CGContextSetStrokeColorWithColor(ctx, color.CGColor);
CGContextSetLineWidth(ctx, 1.0f);
CGContextDrawPath(ctx, kCGPathFillStroke);
}
Me he depurado para asegurarme de que todos los valores numéricos tengan sentido y parece que sí. Realmente no puedo descubrir por qué no se está dibujando nada en la pantalla.
Por lo que vale, esta es una celda definida en una punta también. Y estoy construyendo con el iOS 7 SDK.
¿Algunas ideas?
tahnks