Make +sharedAppDelegate return a generic object instead of a SDLUIKitDelegate.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 19 Nov 2011 19:23:33 -0500
changeset 6090 687400b595ab
parent 6089 30d57832687a
child 6091 61fa4f3238c5
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
src/video/uikit/SDL_uikitappdelegate.m
--- a/src/video/uikit/SDL_uikitappdelegate.h	Sat Nov 19 19:18:20 2011 -0500
+++ b/src/video/uikit/SDL_uikitappdelegate.h	Sat Nov 19 19:23:33 2011 -0500
@@ -24,7 +24,7 @@
 @interface SDLUIKitDelegate : NSObject<UIApplicationDelegate> {
 }
 
-+ (SDLUIKitDelegate *)sharedAppDelegate;
++ (id) sharedAppDelegate;
 + (NSString *)getAppDelegateClassName;
 
 @end
--- a/src/video/uikit/SDL_uikitappdelegate.m	Sat Nov 19 19:18:20 2011 -0500
+++ b/src/video/uikit/SDL_uikitappdelegate.m	Sat Nov 19 19:23:33 2011 -0500
@@ -79,10 +79,10 @@
 @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