IBのウィンドウに接続されているmapWindowというクラスがあります。
いずれにせよ、コードがdrawRectの下にあるか、ウィンドウの境界線を移動しない限り、プログラムにレンダリングさせたい赤い円は表示されません。フォーカスのロックを解除したりロックしたりしても、ウィンドウは更新されません。
theOtherWindowViewは、実際にはIBのカスタムビューに接続されたNSViewです。
- (void)test
{
[theOtherWindowView lockFocus];
NSBezierPath *path = [NSBezierPath bezierPath];
NSPoint center = [self drawPoint];
[path moveToPoint: center];
[path appendBezierPathWithArcWithCenter:center
radius:explosionRadius
startAngle:0
endAngle:360];
[[NSColor redColor] set];
[path fill];
[theOtherWindowView unlockFocus];
}
drawRectを使用したくないのは、更新のたびに座標が変更される1つのシェイプではなく、複数のインスタンスが必要だからです。
私も試しまし[self lockFocus]
た[mapWindow lockFous]