次のCSSコードで得られる効果を複製したいと思います。
background: white url(./img/background.png) no-repeat;
NSViewのサブクラスを作成し、次のdrawRect
ようにオーバーライドしました。
- (void)drawRect:(NSRect)dirtyRect
{
dirtyRect = [self bounds];
[[NSColor whiteColor] setFill];
NSRectFill(dirtyRect);
[[NSColor colorWithPatternImage:[NSImage imageNamed:@"background.png"]] setFill];
NSRectFill(dirtyRect);
}
(英語が下手であることをお詫びします)