Fix compatibility issues with macOS 26 NIB loading

This commit is contained in:
Lior Halphon 2025-06-10 00:22:14 +03:00
parent 19a1e3ec1a
commit 282140822e
2 changed files with 19 additions and 3 deletions

View File

@ -16,7 +16,7 @@
static GBJoyConManager *manager = nil; static GBJoyConManager *manager = nil;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
manager = [[self alloc] _init]; manager = [[super allocWithZone:nil] _init];
}); });
return manager; return manager;
} }
@ -32,6 +32,16 @@
return ret; return ret;
} }
+ (instancetype)allocWithZone:(struct _NSZone *)zone
{
return [self sharedInstance];
}
+ (instancetype)alloc
{
return [self sharedInstance];
}
- (instancetype)init - (instancetype)init
{ {
return [self.class sharedInstance]; return [self.class sharedInstance];

View File

@ -399,10 +399,16 @@ static double blend(double from, double to, double position)
[sender.window.sheetParent endSheet:sender.window]; [sender.window.sheetParent endSheet:sender.window];
} }
- (instancetype)init + (instancetype)alloc
{ {
static id singleton = nil; static id singleton = nil;
if (singleton) return singleton; if (singleton) return singleton;
return (singleton = [super init]); return (singleton = [super allocWithZone:nil]);
} }
+ (instancetype)allocWithZone:(struct _NSZone *)zone
{
return [self alloc];
}
@end @end