Removed private API use that was causing AppStore rejection
authorSam Lantinga <slouken@libsdl.org>
Sat, 12 Feb 2011 07:57:35 -0800
changeset 5266 e107518710f6
parent 5265 48724afcdc6e
child 5267 93ea62a5ba8f
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?
src/video/cocoa/SDL_cocoaevents.m
--- a/src/video/cocoa/SDL_cocoaevents.m	Sat Feb 12 00:42:39 2011 -0800
+++ b/src/video/cocoa/SDL_cocoaevents.m	Sat Feb 12 07:57:35 2011 -0800
@@ -40,13 +40,6 @@
 - (void)setAppleMenu:(NSMenu *)menu;
 @end
 
-@implementation NSApplication(SDL)
-- (void)setRunning
-{
-    _running = 1;
-}
-@end
-
 @interface SDLAppDelegate : NSObject
 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
 @end
@@ -164,7 +157,6 @@
     if ([NSApp delegate] == nil) {
         [NSApp setDelegate:[[SDLAppDelegate alloc] init]];
     }
-    [NSApp setRunning];
     [pool release];
 }
 
@@ -185,7 +177,7 @@
     }
 
     pool = [[NSAutoreleasePool alloc] init];
-    while ([NSApp isRunning]) {
+    for ( ; ; ) {
         NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
         if ( event == nil ) {
             break;