我试图更改我的可可应用程序中的默认光标。我读到了这个,但标准方法对我不起作用。
我尝试将此方法添加到我的 OpenGLView 子类中:
- (void) resetCursorRects
{
[super resetCursorRects];
NSCursor * myCur = [[NSCursor alloc] initWithImage:[NSImage imageNamed:@"1.png"] hotSpot:NSMakePoint(8,0)];
[self addCursorRect: [self bounds]
cursor: myCur];
NSLog(@"Reset cursor rect!");
}
它不工作。为什么?