我试图在我的cocoa应用程序中更改默认光标.我读到了这个,但标准方法对我不起作用.
我尝试将此方法添加到我的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!");
}
Run Code Online (Sandbox Code Playgroud)
它不起作用.为什么?