Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Removed private API use that was causing AppStore rejection
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
slouken committed Feb 12, 2011
1 parent e2db86d commit 172849d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/video/cocoa/SDL_cocoaevents.m
Expand Up @@ -40,13 +40,6 @@ @interface NSApplication(NSAppleMenu)
- (void)setAppleMenu:(NSMenu *)menu;
@end

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

@interface SDLAppDelegate : NSObject
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
@end
Expand Down Expand Up @@ -164,7 +157,6 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende
if ([NSApp delegate] == nil) {
[NSApp setDelegate:[[SDLAppDelegate alloc] init]];
}
[NSApp setRunning];
[pool release];
}

Expand All @@ -185,7 +177,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende
}

pool = [[NSAutoreleasePool alloc] init];
while ([NSApp isRunning]) {
for ( ; ; ) {
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
if ( event == nil ) {
break;
Expand Down

0 comments on commit 172849d

Please sign in to comment.