Mercurial > sdl-ios-xcode
comparison src/video/cocoa/SDL_cocoaevents.m @ 5271:e107518710f6
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?
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 12 Feb 2011 07:57:35 -0800 |
parents | b530ef003506 |
children |
comparison
equal
deleted
inserted
replaced
5270:48724afcdc6e | 5271:e107518710f6 |
---|---|
38 /* setAppleMenu disappeared from the headers in 10.4 */ | 38 /* setAppleMenu disappeared from the headers in 10.4 */ |
39 @interface NSApplication(NSAppleMenu) | 39 @interface NSApplication(NSAppleMenu) |
40 - (void)setAppleMenu:(NSMenu *)menu; | 40 - (void)setAppleMenu:(NSMenu *)menu; |
41 @end | 41 @end |
42 | 42 |
43 @implementation NSApplication(SDL) | |
44 - (void)setRunning | |
45 { | |
46 _running = 1; | |
47 } | |
48 @end | |
49 | |
50 @interface SDLAppDelegate : NSObject | 43 @interface SDLAppDelegate : NSObject |
51 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; | 44 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; |
52 @end | 45 @end |
53 | 46 |
54 @implementation SDLAppDelegate : NSObject | 47 @implementation SDLAppDelegate : NSObject |
162 [NSApp finishLaunching]; | 155 [NSApp finishLaunching]; |
163 } | 156 } |
164 if ([NSApp delegate] == nil) { | 157 if ([NSApp delegate] == nil) { |
165 [NSApp setDelegate:[[SDLAppDelegate alloc] init]]; | 158 [NSApp setDelegate:[[SDLAppDelegate alloc] init]]; |
166 } | 159 } |
167 [NSApp setRunning]; | |
168 [pool release]; | 160 [pool release]; |
169 } | 161 } |
170 | 162 |
171 void | 163 void |
172 Cocoa_PumpEvents(_THIS) | 164 Cocoa_PumpEvents(_THIS) |
183 data->screensaver_activity = now; | 175 data->screensaver_activity = now; |
184 } | 176 } |
185 } | 177 } |
186 | 178 |
187 pool = [[NSAutoreleasePool alloc] init]; | 179 pool = [[NSAutoreleasePool alloc] init]; |
188 while ([NSApp isRunning]) { | 180 for ( ; ; ) { |
189 NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ]; | 181 NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ]; |
190 if ( event == nil ) { | 182 if ( event == nil ) { |
191 break; | 183 break; |
192 } | 184 } |
193 | 185 |