23 lines
589 B
Plaintext
23 lines
589 B
Plaintext
#import <Cocoa/Cocoa.h>
|
|
#import "CursorHelper.h"
|
|
|
|
@implementation CursorHelper
|
|
|
|
+ (NSCursor *)getCursorForSelector:(SEL)selector defaultCursor:(NSCursor *)defaultCursor {
|
|
NSCursor *cursor = nil;
|
|
|
|
#pragma clang diagnostic push
|
|
#pragma clang diagnostic ignored "-Wundeclared-selector"
|
|
if ([NSCursor respondsToSelector:selector]) {
|
|
cursor = [NSCursor performSelector:selector];
|
|
} else {
|
|
NSLog(@"CursorHelper: selector %@ not found", NSStringFromSelector(selector));
|
|
cursor = defaultCursor;
|
|
}
|
|
#pragma clang diagnostic pop
|
|
|
|
return cursor;
|
|
}
|
|
|
|
@end
|