I want to make NSTextView dot border, my drawRect: code is below
- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
CGFloat lineDash[2];
lineDash[0] = 1.0;
lineDash[1] = 1.0;
NSBezierPath *path = [NSBezierPath bezierPathWithRect:self.bounds];
[path setLineDash:lineDash count:2 phase:0.0];
[path stroke];
}
I alse want to give some margin between text and border, my code is below
[textView setTextContainerInset:NSMakeSize(0, 10.0)];
[textView setString:@"This is a testThis is a testThis is a testThis is a test"];
But the result is that the top border is missing, who knows how to fix this?


[super drawRect:dirtyRect]is setting up a clipping rect, so I would try[path setClip]just before[path stroke]. - Smilin Brian