「appendBezierPathWithArcFromPoint」を使用して描画と円弧を作成しようとしていますが、実行すると円弧が描画されません。「lineToPont」が機能し、他の「NSBezierPath」コマンドが機能します。私が間違っていることを教えてください。私は明確な答えなしでかなりの検索をしました。MAC OS 10.9.2 と XCode 5.1 を使用しています。以下はコードのスニペットです。ありがとうございました。
#import "MyView.h"
@implementation MyView
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code here.
}
return self;
}
- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
NSRect bounds = [self bounds];
NSBezierPath *thePath = [NSBezierPath bezierPath]; // all drawing instruction goes to thePath.
[NSBezierPath setDefaultLineWidth:2.0];
[[NSColor blackColor] set];
[thePath moveToPoint:NSMakePoint(0, 0)];
[thePath lineToPoint:NSMakePoint(100, 30)];
[thePath appendBezierPathWithArcFromPoint:NSMakePoint(100,30) toPoint:NSMakePoint(130,0) radius:30];
[thePath stroke];
}
@end