我有用于更改按钮图像的代码:
- (void)mouseEntered:(NSEvent *)event {
[self setImage:[NSImage imageNamed:@"FloatingButton_hover"]]; }
- (void)mouseExited:(NSEvent *)event {
[self setImage:[NSImage imageNamed:@"FloatingButton_normal"]]; }
但我的资源中有2张@ 2x图像。我怎么知道Mac是否有视网膜,所以我可以[self setImage:[NSImage imageNamed:@"FloatingButton_normal@2x"]]
?还是有其他办法吗?
感谢