Removed private API use that was causing AppStore rejection
authorSam Lantinga
Sat, 12 Feb 2011 07:57:35 -0800
changeset 5266e107518710f6
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
     1.1 --- a/src/video/cocoa/SDL_cocoaevents.m	Sat Feb 12 00:42:39 2011 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoaevents.m	Sat Feb 12 07:57:35 2011 -0800
     1.3 @@ -40,13 +40,6 @@
     1.4  - (void)setAppleMenu:(NSMenu *)menu;
     1.5  @end
     1.6  
     1.7 -@implementation NSApplication(SDL)
     1.8 -- (void)setRunning
     1.9 -{
    1.10 -    _running = 1;
    1.11 -}
    1.12 -@end
    1.13 -
    1.14  @interface SDLAppDelegate : NSObject
    1.15  - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
    1.16  @end
    1.17 @@ -164,7 +157,6 @@
    1.18      if ([NSApp delegate] == nil) {
    1.19          [NSApp setDelegate:[[SDLAppDelegate alloc] init]];
    1.20      }
    1.21 -    [NSApp setRunning];
    1.22      [pool release];
    1.23  }
    1.24  
    1.25 @@ -185,7 +177,7 @@
    1.26      }
    1.27  
    1.28      pool = [[NSAutoreleasePool alloc] init];
    1.29 -    while ([NSApp isRunning]) {
    1.30 +    for ( ; ; ) {
    1.31          NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
    1.32          if ( event == nil ) {
    1.33              break;