mirror of https://github.com/LIJI32/SameBoy.git
Fix compatibility issues with macOS 26 NIB loading
This commit is contained in:
parent
19a1e3ec1a
commit
282140822e
|
@ -16,7 +16,7 @@
|
|||
static GBJoyConManager *manager = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
manager = [[self alloc] _init];
|
||||
manager = [[super allocWithZone:nil] _init];
|
||||
});
|
||||
return manager;
|
||||
}
|
||||
|
@ -32,6 +32,16 @@
|
|||
return ret;
|
||||
}
|
||||
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone
|
||||
{
|
||||
return [self sharedInstance];
|
||||
}
|
||||
|
||||
+ (instancetype)alloc
|
||||
{
|
||||
return [self sharedInstance];
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
return [self.class sharedInstance];
|
||||
|
|
|
@ -399,10 +399,16 @@ static double blend(double from, double to, double position)
|
|||
[sender.window.sheetParent endSheet:sender.window];
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
+ (instancetype)alloc
|
||||
{
|
||||
static id singleton = nil;
|
||||
if (singleton) return singleton;
|
||||
return (singleton = [super init]);
|
||||
return (singleton = [super allocWithZone:nil]);
|
||||
}
|
||||
|
||||
+ (instancetype)allocWithZone:(struct _NSZone *)zone
|
||||
{
|
||||
return [self alloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue