I am writing an iPad app in which I am rendering XML objects that represent shapes into graphics on the screen. One of the objects I am trying to render is arcs. Essentially the
You can probably achieve what you want by setting up a clip path around the drawing of the ellipse.
CGContextSaveGState(theCGContext);
CGPoint center = CGPointMake(x + width / 2.0, y + height / 2.0);
UIBezierPath* clip = [UIBezierPath bezierPathWithArcCenter:center
radius:max(width, height)
startAngle:startAngle
endAngle:endAngle
clockwise:YES];
[clip addLineToPoint:center];
[clip closePath];
[clip addClip];
UIBezierPath *arc = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(x, y, width, height)];
[[UIColor blackColor] setStroke];
[arc stroke];
CGContextRestoreGState(theCGContext);
The exact radius for the clipping isn't important. It needs to be big enough so it only clips the ellipse at the ends, not through the desired arc.