From 162e2c3270a07510a31d6d1948670781f6b80f5d Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 19 Nov 2011 19:23:33 -0500 Subject: [PATCH] Make +sharedAppDelegate return a generic object instead of a SDLUIKitDelegate. This way subclasses can use it without a lot of casting. Thanks to Vittorio Giovara for the patch! --- src/video/uikit/SDL_uikitappdelegate.h | 2 +- src/video/uikit/SDL_uikitappdelegate.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/uikit/SDL_uikitappdelegate.h b/src/video/uikit/SDL_uikitappdelegate.h index 36f746dd4..6668d1aa1 100644 --- a/src/video/uikit/SDL_uikitappdelegate.h +++ b/src/video/uikit/SDL_uikitappdelegate.h @@ -24,7 +24,7 @@ @interface SDLUIKitDelegate : NSObject { } -+ (SDLUIKitDelegate *)sharedAppDelegate; ++ (id) sharedAppDelegate; + (NSString *)getAppDelegateClassName; @end diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index 9a3580051..5b7965562 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -79,10 +79,10 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, @implementation SDLUIKitDelegate /* convenience method */ -+ (SDLUIKitDelegate *)sharedAppDelegate ++ (id) sharedAppDelegate { /* the delegate is set in UIApplicationMain(), which is garaunteed to be called before this method */ - return (SDLUIKitDelegate *)[[UIApplication sharedApplication] delegate]; + return [[UIApplication sharedApplication] delegate]; } + (NSString *)getAppDelegateClassName