Commit 8443161f authored by Sam Lantinga's avatar Sam Lantinga

Removed private API use that was causing AppStore rejection

Pavel Kanzelsberger to SDL

I tried to submit a SDL application to the Mac AppStore and it got rejected because SDL cocoa is using a Private (non-public) API. Problematic part is here:

SDL_cocoaevents.m

@implementation NSApplication(SDL)
- (void)setRunning
{
    _running = 1;
}
@end

Symbol _running in NSApplication is private and shouldn't be used. Any ideas what could I do about this?
parent 78a17dbc
...@@ -40,13 +40,6 @@ ...@@ -40,13 +40,6 @@
- (void)setAppleMenu:(NSMenu *)menu; - (void)setAppleMenu:(NSMenu *)menu;
@end @end
@implementation NSApplication(SDL)
- (void)setRunning
{
_running = 1;
}
@end
@interface SDLAppDelegate : NSObject @interface SDLAppDelegate : NSObject
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
@end @end
...@@ -164,7 +157,6 @@ Cocoa_RegisterApp(void) ...@@ -164,7 +157,6 @@ Cocoa_RegisterApp(void)
if ([NSApp delegate] == nil) { if ([NSApp delegate] == nil) {
[NSApp setDelegate:[[SDLAppDelegate alloc] init]]; [NSApp setDelegate:[[SDLAppDelegate alloc] init]];
} }
[NSApp setRunning];
[pool release]; [pool release];
} }
...@@ -185,7 +177,7 @@ Cocoa_PumpEvents(_THIS) ...@@ -185,7 +177,7 @@ Cocoa_PumpEvents(_THIS)
} }
pool = [[NSAutoreleasePool alloc] init]; pool = [[NSAutoreleasePool alloc] init];
while ([NSApp isRunning]) { for ( ; ; ) {
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ]; NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
if ( event == nil ) { if ( event == nil ) {
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment