Updated the iOS backend code to use Objective-C's automatic reference counting (ARC). iOS-improvements
authorAlex Szpakowski <slime73@gmail.com>
Wed, 06 Aug 2014 03:24:16 -0300
branchiOS-improvements
changeset 9510e19faa3b5d88
parent 9509 350f38eb3d0f
child 9511 f08e88fe9de5
Updated the iOS backend code to use Objective-C's automatic reference counting (ARC).
Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
include/SDL_syswm.h
src/file/cocoa/SDL_rwopsbundlesupport.m
src/joystick/iphoneos/SDL_sysjoystick.m
src/video/uikit/SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitmessagebox.m
src/video/uikit/SDL_uikitmodes.h
src/video/uikit/SDL_uikitmodes.m
src/video/uikit/SDL_uikitopengles.m
src/video/uikit/SDL_uikitopenglview.h
src/video/uikit/SDL_uikitopenglview.m
src/video/uikit/SDL_uikitview.h
src/video/uikit/SDL_uikitview.m
src/video/uikit/SDL_uikitwindow.h
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj	Wed Aug 06 00:45:11 2014 -0300
     1.2 +++ b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj	Wed Aug 06 03:24:16 2014 -0300
     1.3 @@ -1274,8 +1274,14 @@
     1.4  		FD6526640DE8FCCB002AD96B /* Debug */ = {
     1.5  			isa = XCBuildConfiguration;
     1.6  			buildSettings = {
     1.7 +				CLANG_ENABLE_OBJC_ARC = YES;
     1.8 +				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
     1.9 +				CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
    1.10  				COPY_PHASE_STRIP = NO;
    1.11  				IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
    1.12 +				GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;
    1.13 +				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
    1.14 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
    1.15  				PRODUCT_NAME = SDL2;
    1.16  				SKIP_INSTALL = YES;
    1.17  			};
    1.18 @@ -1284,8 +1290,14 @@
    1.19  		FD6526650DE8FCCB002AD96B /* Release */ = {
    1.20  			isa = XCBuildConfiguration;
    1.21  			buildSettings = {
    1.22 +				CLANG_ENABLE_OBJC_ARC = YES;
    1.23 +				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
    1.24 +				CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
    1.25  				COPY_PHASE_STRIP = YES;
    1.26  				IPHONEOS_DEPLOYMENT_TARGET = 5.1.1;
    1.27 +				GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;
    1.28 +				GCC_WARN_STRICT_SELECTOR_MATCH = YES;
    1.29 +				GCC_WARN_UNDECLARED_SELECTOR = YES;
    1.30  				PRODUCT_NAME = SDL2;
    1.31  				SKIP_INSTALL = YES;
    1.32  			};
     2.1 --- a/include/SDL_syswm.h	Wed Aug 06 00:45:11 2014 -0300
     2.2 +++ b/include/SDL_syswm.h	Wed Aug 06 03:24:16 2014 -0300
     2.3 @@ -209,9 +209,9 @@
     2.4          struct
     2.5          {
     2.6  #if defined(__OBJC__) && __has_feature(objc_arc)
     2.7 -            NSWindow __unsafe_unretained *window; /* The Cocoa window */
     2.8 +            NSWindow * __unsafe_unretained window; /* The Cocoa window */
     2.9  #else
    2.10 -            NSWindow *window;                     /* The Cocoa window */
    2.11 +            NSWindow *window;                      /* The Cocoa window */
    2.12  #endif
    2.13          } cocoa;
    2.14  #endif
    2.15 @@ -219,9 +219,9 @@
    2.16          struct
    2.17          {
    2.18  #if defined(__OBJC__) && __has_feature(objc_arc)
    2.19 -            UIWindow __unsafe_unretained *window; /* The UIKit window */
    2.20 +            UIWindow * __unsafe_unretained window; /* The UIKit window */
    2.21  #else
    2.22 -            UIWindow *window;                     /* The UIKit window */
    2.23 +            UIWindow *window;                      /* The UIKit window */
    2.24  #endif
    2.25          } uikit;
    2.26  #endif
     3.1 --- a/src/file/cocoa/SDL_rwopsbundlesupport.m	Wed Aug 06 00:45:11 2014 -0300
     3.2 +++ b/src/file/cocoa/SDL_rwopsbundlesupport.m	Wed Aug 06 03:24:16 2014 -0300
     3.3 @@ -50,8 +50,7 @@
     3.4          NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component];
     3.5          if([file_manager fileExistsAtPath:full_path_with_file_to_try]) {
     3.6              fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode);
     3.7 -        }
     3.8 -        else {
     3.9 +        } else {
    3.10              fp = fopen(file, mode);
    3.11          }
    3.12      }
     4.1 --- a/src/joystick/iphoneos/SDL_sysjoystick.m	Wed Aug 06 00:45:11 2014 -0300
     4.2 +++ b/src/joystick/iphoneos/SDL_sysjoystick.m	Wed Aug 06 03:24:16 2014 -0300
     4.3 @@ -176,10 +176,7 @@
     4.4  SDL_SYS_JoystickQuit(void)
     4.5  {
     4.6      @autoreleasepool {
     4.7 -        if (motionManager != nil) {
     4.8 -            [motionManager release];
     4.9 -            motionManager = nil;
    4.10 -        }
    4.11 +        motionManager = nil;
    4.12      }
    4.13  
    4.14      numjoysticks = 0;
     5.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Wed Aug 06 00:45:11 2014 -0300
     5.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Wed Aug 06 03:24:16 2014 -0300
     5.3 @@ -56,7 +56,7 @@
     5.4  
     5.5      /* Give over control to run loop, SDLUIKitDelegate will handle most things from here */
     5.6      @autoreleasepool {
     5.7 -        UIApplicationMain(argc, argv, NULL, [SDLUIKitDelegate getAppDelegateClassName]);
     5.8 +        UIApplicationMain(argc, argv, nil, [SDLUIKitDelegate getAppDelegateClassName]);
     5.9      }
    5.10  
    5.11      /* free the memory we used to hold copies of argc and argv */
    5.12 @@ -94,26 +94,20 @@
    5.13          return nil;
    5.14      }
    5.15  
    5.16 -    self->splash = [[UIImageView alloc] init];
    5.17 -    [self setView:self->splash];
    5.18 +    splash = [[UIImageView alloc] init];
    5.19 +    self.view = splash;
    5.20  
    5.21      CGSize size = [UIScreen mainScreen].bounds.size;
    5.22      float height = SDL_max(size.width, size.height);
    5.23 -    self->splashPortrait = [UIImage imageNamed:[NSString stringWithFormat:@"Default-%dh.png", (int)height]];
    5.24 -    if (!self->splashPortrait) {
    5.25 -        self->splashPortrait = [UIImage imageNamed:@"Default.png"];
    5.26 +    splashPortrait = [UIImage imageNamed:[NSString stringWithFormat:@"Default-%dh.png", (int)height]];
    5.27 +    if (!splashPortrait) {
    5.28 +        splashPortrait = [UIImage imageNamed:@"Default.png"];
    5.29      }
    5.30 -    self->splashLandscape = [UIImage imageNamed:@"Default-Landscape.png"];
    5.31 -    if (!self->splashLandscape && self->splashPortrait) {
    5.32 -        self->splashLandscape = [[UIImage alloc] initWithCGImage: self->splashPortrait.CGImage
    5.33 -                                                           scale: 1.0
    5.34 -                                                     orientation: UIImageOrientationRight];
    5.35 -    }
    5.36 -    if (self->splashPortrait) {
    5.37 -        [self->splashPortrait retain];
    5.38 -    }
    5.39 -    if (self->splashLandscape) {
    5.40 -        [self->splashLandscape retain];
    5.41 +    splashLandscape = [UIImage imageNamed:@"Default-Landscape.png"];
    5.42 +    if (!splashLandscape && splashPortrait) {
    5.43 +        splashLandscape = [[UIImage alloc] initWithCGImage: splashPortrait.CGImage
    5.44 +                                                     scale: 1.0
    5.45 +                                               orientation: UIImageOrientationRight];
    5.46      }
    5.47  
    5.48      [self updateSplashImage:[[UIApplication sharedApplication] statusBarOrientation]];
    5.49 @@ -148,9 +142,9 @@
    5.50      UIImage *image;
    5.51  
    5.52      if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
    5.53 -        image = self->splashLandscape;
    5.54 +        image = splashLandscape;
    5.55      } else {
    5.56 -        image = self->splashPortrait;
    5.57 +        image = splashPortrait;
    5.58      }
    5.59  
    5.60      if (image) {
    5.61 @@ -192,8 +186,7 @@
    5.62  
    5.63      /* If we showed a splash image, clean it up */
    5.64      if (launch_window) {
    5.65 -        [launch_window release];
    5.66 -        launch_window = NULL;
    5.67 +        launch_window = nil;
    5.68      }
    5.69  
    5.70      /* exit, passing the return status from the user's application */
     6.1 --- a/src/video/uikit/SDL_uikitmessagebox.m	Wed Aug 06 00:45:11 2014 -0300
     6.2 +++ b/src/video/uikit/SDL_uikitmessagebox.m	Wed Aug 06 03:24:16 2014 -0300
     6.3 @@ -76,13 +76,14 @@
     6.4  
     6.5      @autoreleasepool {
     6.6          UIAlertView* alert = [[UIAlertView alloc] init];
     6.7 +        UIKit_UIAlertViewDelegate *delegate = [[UIKit_UIAlertViewDelegate alloc] initWithButtonIndex:&clicked];
     6.8  
     6.9          alert.title = @(messageboxdata->title);
    6.10          alert.message = @(messageboxdata->message);
    6.11 -        alert.delegate = [[UIKit_UIAlertViewDelegate alloc] initWithButtonIndex:&clicked];
    6.12 +        alert.delegate = delegate;
    6.13  
    6.14          for (i = 0; i < messageboxdata->numbuttons; ++i) {
    6.15 -            [alert addButtonWithTitle:[[NSString alloc] initWithUTF8String:buttons[i].text]];
    6.16 +            [alert addButtonWithTitle:@(buttons[i].text)];
    6.17          }
    6.18  
    6.19          /* Set up for showing the alert */
    6.20 @@ -100,8 +101,7 @@
    6.21  
    6.22          *buttonid = messageboxdata->buttons[clicked].buttonid;
    6.23  
    6.24 -        [alert.delegate release];
    6.25 -        [alert release];
    6.26 +        alert.delegate = nil;
    6.27      }
    6.28  
    6.29      return 0;
     7.1 --- a/src/video/uikit/SDL_uikitmodes.h	Wed Aug 06 00:45:11 2014 -0300
     7.2 +++ b/src/video/uikit/SDL_uikitmodes.h	Wed Aug 06 03:24:16 2014 -0300
     7.3 @@ -25,15 +25,17 @@
     7.4  
     7.5  #include "SDL_uikitvideo.h"
     7.6  
     7.7 -typedef struct
     7.8 -{
     7.9 -    UIScreen *uiscreen;
    7.10 -} SDL_DisplayData;
    7.11 +@interface SDL_DisplayData : NSObject
    7.12  
    7.13 -typedef struct
    7.14 -{
    7.15 -    UIScreenMode *uiscreenmode;
    7.16 -} SDL_DisplayModeData;
    7.17 +@property (nonatomic, strong) UIScreen *uiscreen;
    7.18 +
    7.19 +@end
    7.20 +
    7.21 +@interface SDL_DisplayModeData : NSObject
    7.22 +
    7.23 +@property (nonatomic, strong) UIScreenMode *uiscreenmode;
    7.24 +
    7.25 +@end
    7.26  
    7.27  extern SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen);
    7.28  
     8.1 --- a/src/video/uikit/SDL_uikitmodes.m	Wed Aug 06 00:45:11 2014 -0300
     8.2 +++ b/src/video/uikit/SDL_uikitmodes.m	Wed Aug 06 03:24:16 2014 -0300
     8.3 @@ -25,25 +25,36 @@
     8.4  #include "SDL_assert.h"
     8.5  #include "SDL_uikitmodes.h"
     8.6  
     8.7 +@implementation SDL_DisplayData
     8.8 +
     8.9 +@synthesize uiscreen;
    8.10 +
    8.11 +@end
    8.12 +
    8.13 +@implementation SDL_DisplayModeData
    8.14 +
    8.15 +@synthesize uiscreenmode;
    8.16 +
    8.17 +@end
    8.18 +
    8.19  
    8.20  static int
    8.21  UIKit_AllocateDisplayModeData(SDL_DisplayMode * mode,
    8.22      UIScreenMode * uiscreenmode)
    8.23  {
    8.24 -    SDL_DisplayModeData *data = NULL;
    8.25 +    SDL_DisplayModeData *data = nil;
    8.26  
    8.27      if (uiscreenmode != nil) {
    8.28          /* Allocate the display mode data */
    8.29 -        data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data));
    8.30 +        data = [[SDL_DisplayModeData alloc] init];
    8.31          if (!data) {
    8.32              return SDL_OutOfMemory();
    8.33          }
    8.34  
    8.35 -        data->uiscreenmode = uiscreenmode;
    8.36 -        [data->uiscreenmode retain];
    8.37 +        data.uiscreenmode = uiscreenmode;
    8.38      }
    8.39  
    8.40 -    mode->driverdata = data;
    8.41 +    mode->driverdata = (void *) CFBridgingRetain(data);
    8.42  
    8.43      return 0;
    8.44  }
    8.45 @@ -52,9 +63,7 @@
    8.46  UIKit_FreeDisplayModeData(SDL_DisplayMode * mode)
    8.47  {
    8.48      if (mode->driverdata != NULL) {
    8.49 -        SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata;
    8.50 -        [data->uiscreenmode release];
    8.51 -        SDL_free(data);
    8.52 +        CFRelease(mode->driverdata);
    8.53          mode->driverdata = NULL;
    8.54      }
    8.55  }
    8.56 @@ -130,18 +139,18 @@
    8.57      display.current_mode = mode;
    8.58  
    8.59      /* Allocate the display data */
    8.60 -    SDL_DisplayData *data = (SDL_DisplayData *) SDL_malloc(sizeof(*data));
    8.61 +    SDL_DisplayData *data = [[SDL_DisplayData alloc] init];
    8.62      if (!data) {
    8.63          UIKit_FreeDisplayModeData(&display.desktop_mode);
    8.64          return SDL_OutOfMemory();
    8.65      }
    8.66  
    8.67 -    [uiscreen retain];
    8.68 -    data->uiscreen = uiscreen;
    8.69 +    data.uiscreen = uiscreen;
    8.70  
    8.71 -    display.driverdata = data;
    8.72 +    display.driverdata = (void *) CFBridgingRetain(data);
    8.73      SDL_AddVideoDisplay(&display);
    8.74  
    8.75 +
    8.76      return 0;
    8.77  }
    8.78  
    8.79 @@ -173,14 +182,14 @@
    8.80  void
    8.81  UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
    8.82  {
    8.83 -    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
    8.84 +    @autoreleasepool {
    8.85 +        SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;
    8.86  
    8.87 -    @autoreleasepool {
    8.88 -        SDL_bool isLandscape = UIKit_IsDisplayLandscape(data->uiscreen);
    8.89 -        SDL_bool addRotation = (data->uiscreen == [UIScreen mainScreen]);
    8.90 -        CGFloat scale = data->uiscreen.scale;
    8.91 +        SDL_bool isLandscape = UIKit_IsDisplayLandscape(data.uiscreen);
    8.92 +        SDL_bool addRotation = (data.uiscreen == [UIScreen mainScreen]);
    8.93 +        CGFloat scale = data.uiscreen.scale;
    8.94  
    8.95 -        for (UIScreenMode *uimode in [data->uiscreen availableModes]) {
    8.96 +        for (UIScreenMode *uimode in [data.uiscreen availableModes]) {
    8.97              /* The size of a UIScreenMode is in pixels, but we deal exclusively in
    8.98               * points (except in SDL_GL_GetDrawableSize.) */
    8.99              CGSize size = [uimode size];
   8.100 @@ -203,19 +212,19 @@
   8.101  int
   8.102  UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
   8.103  {
   8.104 -    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
   8.105 -    SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata;
   8.106 +    @autoreleasepool {
   8.107 +        SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;
   8.108 +        SDL_DisplayModeData *modedata = (__bridge SDL_DisplayModeData *)mode->driverdata;
   8.109  
   8.110 -    @autoreleasepool {
   8.111 -        [data->uiscreen setCurrentMode:modedata->uiscreenmode];
   8.112 +        [data.uiscreen setCurrentMode:modedata.uiscreenmode];
   8.113  
   8.114 -        if (data->uiscreen == [UIScreen mainScreen]) {
   8.115 +        if (data.uiscreen == [UIScreen mainScreen]) {
   8.116              if (mode->w > mode->h) {
   8.117 -                if (!UIKit_IsDisplayLandscape(data->uiscreen)) {
   8.118 +                if (!UIKit_IsDisplayLandscape(data.uiscreen)) {
   8.119                      [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
   8.120                  }
   8.121              } else if (mode->w < mode->h) {
   8.122 -                if (UIKit_IsDisplayLandscape(data->uiscreen)) {
   8.123 +                if (UIKit_IsDisplayLandscape(data.uiscreen)) {
   8.124                      [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
   8.125                  }
   8.126              }
   8.127 @@ -240,10 +249,10 @@
   8.128                  UIKit_FreeDisplayModeData(mode);
   8.129              }
   8.130  
   8.131 -            SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
   8.132 -            [data->uiscreen release];
   8.133 -            SDL_free(data);
   8.134 -            display->driverdata = NULL;
   8.135 +            if (display->driverdata != NULL) {
   8.136 +                CFRelease(display->driverdata);
   8.137 +                display->driverdata = NULL;
   8.138 +            }
   8.139          }
   8.140      }
   8.141  }
     9.1 --- a/src/video/uikit/SDL_uikitopengles.m	Wed Aug 06 00:45:11 2014 -0300
     9.2 +++ b/src/video/uikit/SDL_uikitopengles.m	Wed Aug 06 03:24:16 2014 -0300
     9.3 @@ -54,8 +54,8 @@
     9.4  {
     9.5      @autoreleasepool {
     9.6          if (context) {
     9.7 -            SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
     9.8 -            [data->view setCurrentContext];
     9.9 +            SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata;
    9.10 +            [data.view setCurrentContext];
    9.11          }
    9.12          else {
    9.13              [EAGLContext setCurrentContext: nil];
    9.14 @@ -67,14 +67,14 @@
    9.15  
    9.16  void UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h)
    9.17  {
    9.18 -    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
    9.19 +    @autoreleasepool {
    9.20 +        SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata;
    9.21  
    9.22 -    @autoreleasepool {
    9.23          if (w) {
    9.24 -            *w = data->view.backingWidth;
    9.25 +            *w = data.view.backingWidth;
    9.26          }
    9.27          if (h) {
    9.28 -            *h = data->view.backingHeight;
    9.29 +            *h = data.view.backingHeight;
    9.30          }
    9.31      }
    9.32  }
    9.33 @@ -97,17 +97,17 @@
    9.34  void UIKit_GL_SwapWindow(_THIS, SDL_Window * window)
    9.35  {
    9.36      @autoreleasepool {
    9.37 +        SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata;
    9.38 +
    9.39  #if SDL_POWER_UIKIT
    9.40          /* Check once a frame to see if we should turn off the battery monitor. */
    9.41          SDL_UIKit_UpdateBatteryMonitoring();
    9.42  #endif
    9.43  
    9.44 -        SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
    9.45 -
    9.46 -        if (nil == data->view) {
    9.47 +        if (data.view == nil) {
    9.48              return;
    9.49          }
    9.50 -        [data->view swapBuffers];
    9.51 +        [data.view swapBuffers];
    9.52  
    9.53          /* You need to pump events in order for the OS to make changes visible.
    9.54             We don't pump events here because we don't want iOS application events
    9.55 @@ -121,8 +121,8 @@
    9.56  {
    9.57      @autoreleasepool {
    9.58          SDL_uikitopenglview *view;
    9.59 -        SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    9.60 -        UIWindow *uiwindow = data->uiwindow;
    9.61 +        SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
    9.62 +        UIWindow *uiwindow = data.uiwindow;
    9.63          CGRect frame = UIKit_ComputeViewFrame(window, uiwindow.screen);
    9.64          EAGLSharegroup *share_group = nil;
    9.65          CGFloat scale = 1.0;
    9.66 @@ -136,7 +136,7 @@
    9.67          }
    9.68  
    9.69          if (_this->gl_config.share_with_current_context) {
    9.70 -            SDL_uikitopenglview *view = (SDL_uikitopenglview *) SDL_GL_GetCurrentContext();
    9.71 +            SDL_uikitopenglview *view = (__bridge SDL_uikitopenglview *) SDL_GL_GetCurrentContext();
    9.72              share_group = [view.context sharegroup];
    9.73          }
    9.74  
    9.75 @@ -157,21 +157,20 @@
    9.76              return NULL;
    9.77          }
    9.78  
    9.79 -        data->view = view;
    9.80 -        view->viewcontroller = data->viewcontroller;
    9.81 -        if (view->viewcontroller != nil) {
    9.82 -            [view->viewcontroller setView:view];
    9.83 -            [view->viewcontroller retain];
    9.84 +        data.view = view;
    9.85 +        view.viewcontroller = data.viewcontroller;
    9.86 +        if (view.viewcontroller != nil) {
    9.87 +            view.viewcontroller.view = view;
    9.88          }
    9.89          [uiwindow addSubview: view];
    9.90  
    9.91          /* The view controller needs to be the root in order to control rotation on iOS 6.0 */
    9.92          if (uiwindow.rootViewController == nil) {
    9.93 -            uiwindow.rootViewController = view->viewcontroller;
    9.94 +            uiwindow.rootViewController = view.viewcontroller;
    9.95          }
    9.96  
    9.97 -        if (UIKit_GL_MakeCurrent(_this, window, view) < 0) {
    9.98 -            UIKit_GL_DeleteContext(_this, view);
    9.99 +        if (UIKit_GL_MakeCurrent(_this, window, (__bridge SDL_GLContext)(view)) < 0) {
   9.100 +            UIKit_GL_DeleteContext(_this, (SDL_GLContext) CFBridgingRetain(view));
   9.101              return NULL;
   9.102          }
   9.103  
   9.104 @@ -181,7 +180,7 @@
   9.105              SDL_SetKeyboardFocus(window);
   9.106          }
   9.107  
   9.108 -        return view;
   9.109 +        return (SDL_GLContext) CFBridgingRetain(view);
   9.110      }
   9.111  }
   9.112  
   9.113 @@ -190,17 +189,15 @@
   9.114  {
   9.115      @autoreleasepool {
   9.116          /* the delegate has retained the view, this will release him */
   9.117 -        SDL_uikitopenglview *view = (SDL_uikitopenglview *)context;
   9.118 -        if (view->viewcontroller) {
   9.119 +        SDL_uikitopenglview *view = (SDL_uikitopenglview *)CFBridgingRelease(context);
   9.120 +        if (view.viewcontroller) {
   9.121              UIWindow *uiwindow = (UIWindow *)view.superview;
   9.122 -            if (uiwindow.rootViewController == view->viewcontroller) {
   9.123 +            if (uiwindow.rootViewController == view.viewcontroller) {
   9.124                  uiwindow.rootViewController = nil;
   9.125              }
   9.126 -            [view->viewcontroller setView:nil];
   9.127 -            [view->viewcontroller release];
   9.128 +            view.viewcontroller.view = nil;
   9.129          }
   9.130          [view removeFromSuperview];
   9.131 -        [view release];
   9.132      }
   9.133  }
   9.134  
    10.1 --- a/src/video/uikit/SDL_uikitopenglview.h	Wed Aug 06 00:45:11 2014 -0300
    10.2 +++ b/src/video/uikit/SDL_uikitopenglview.h	Wed Aug 06 03:24:16 2014 -0300
    10.3 @@ -44,7 +44,7 @@
    10.4         majorVersion:(int)majorVersion
    10.5           shareGroup:(EAGLSharegroup*)shareGroup;
    10.6  
    10.7 -@property (nonatomic, retain, readonly) EAGLContext *context;
    10.8 +@property (nonatomic, strong, readonly) EAGLContext *context;
    10.9  
   10.10  /* The width and height of the drawable in pixels (as opposed to points.) */
   10.11  @property (nonatomic, readonly) int backingWidth;
    11.1 --- a/src/video/uikit/SDL_uikitopenglview.m	Wed Aug 06 00:45:11 2014 -0300
    11.2 +++ b/src/video/uikit/SDL_uikitopenglview.m	Wed Aug 06 03:24:16 2014 -0300
    11.3 @@ -85,7 +85,6 @@
    11.4  
    11.5          context = [[EAGLContext alloc] initWithAPI:api sharegroup:shareGroup];
    11.6          if (!context || ![EAGLContext setCurrentContext:context]) {
    11.7 -            [self release];
    11.8              SDL_SetError("OpenGL ES %d not supported", majorVersion);
    11.9              return nil;
   11.10          }
   11.11 @@ -118,7 +117,6 @@
   11.12          glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
   11.13  
   11.14          if (![context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:eaglLayer]) {
   11.15 -            [self release];
   11.16              SDL_SetError("Failed creating OpenGL ES drawable");
   11.17              return nil;
   11.18          }
   11.19 @@ -154,7 +152,6 @@
   11.20          }
   11.21  
   11.22          if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
   11.23 -            [self release];
   11.24              SDL_SetError("Failed creating OpenGL ES framebuffer");
   11.25              return nil;
   11.26          }
   11.27 @@ -268,12 +265,10 @@
   11.28  
   11.29  - (void)dealloc
   11.30  {
   11.31 -    [self destroyFramebuffer];
   11.32      if ([EAGLContext currentContext] == context) {
   11.33 +        [self destroyFramebuffer];
   11.34          [EAGLContext setCurrentContext:nil];
   11.35      }
   11.36 -    [context release];
   11.37 -    [super dealloc];
   11.38  }
   11.39  
   11.40  @end
    12.1 --- a/src/video/uikit/SDL_uikitview.h	Wed Aug 06 00:45:11 2014 -0300
    12.2 +++ b/src/video/uikit/SDL_uikitview.h	Wed Aug 06 03:24:16 2014 -0300
    12.3 @@ -31,13 +31,12 @@
    12.4  #endif
    12.5  
    12.6  #if SDL_IPHONE_KEYBOARD
    12.7 -@interface SDL_uikitview : UIView<UITextFieldDelegate> {
    12.8 +@interface SDL_uikitview : UIView <UITextFieldDelegate>
    12.9  #else
   12.10 -@interface SDL_uikitview : UIView {
   12.11 +@interface SDL_uikitview : UIView
   12.12  #endif
   12.13 -@public
   12.14 -    SDL_uikitviewcontroller *viewcontroller;
   12.15 -}
   12.16 +
   12.17 +@property (nonatomic, weak) SDL_uikitviewcontroller *viewcontroller;
   12.18  
   12.19  - (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize;
   12.20  - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
    13.1 --- a/src/video/uikit/SDL_uikitview.m	Wed Aug 06 00:45:11 2014 -0300
    13.2 +++ b/src/video/uikit/SDL_uikitview.m	Wed Aug 06 03:24:16 2014 -0300
    13.3 @@ -51,6 +51,8 @@
    13.4  
    13.5  }
    13.6  
    13.7 +@synthesize viewcontroller;
    13.8 +
    13.9  - (id)initWithFrame:(CGRect)frame
   13.10  {
   13.11      if (self = [super initWithFrame: frame]) {
   13.12 @@ -88,10 +90,10 @@
   13.13              CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
   13.14  
   13.15              /* send moved event */
   13.16 -            SDL_SendMouseMotion(viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
   13.17 +            SDL_SendMouseMotion(self.viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
   13.18  
   13.19              /* send mouse down event */
   13.20 -            SDL_SendMouseButton(viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
   13.21 +            SDL_SendMouseButton(self.viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
   13.22  
   13.23              leftFingerDown = touch;
   13.24          }
   13.25 @@ -123,7 +125,7 @@
   13.26      for (UITouch *touch in touches) {
   13.27          if (touch == leftFingerDown) {
   13.28              /* send mouse up */
   13.29 -            SDL_SendMouseButton(viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
   13.30 +            SDL_SendMouseButton(self.viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
   13.31              leftFingerDown = nil;
   13.32          }
   13.33  
   13.34 @@ -162,7 +164,7 @@
   13.35              CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
   13.36  
   13.37              /* send moved event */
   13.38 -            SDL_SendMouseMotion(viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
   13.39 +            SDL_SendMouseMotion(self.viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
   13.40          }
   13.41  
   13.42          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   13.43 @@ -212,7 +214,6 @@
   13.44      keyboardVisible = NO;
   13.45      /* add the UITextField (hidden) to our view */
   13.46      [self addSubview: textField];
   13.47 -    [textField release];
   13.48      
   13.49      _uikit_keyboard_init();
   13.50  }
   13.51 @@ -301,8 +302,8 @@
   13.52          return nil;
   13.53      }
   13.54  
   13.55 -    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
   13.56 -    SDL_uikitview *view = data != NULL ? data->view : nil;
   13.57 +    SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata;
   13.58 +    SDL_uikitview *view = data != nil ? data.view : nil;
   13.59  
   13.60      if (view == nil) {
   13.61          SDL_SetError("Window has no view");
   13.62 @@ -352,11 +353,11 @@
   13.63  void _uikit_keyboard_update() {
   13.64      SDL_Window *window = SDL_GetFocusWindow();
   13.65      if (!window) { return; }
   13.66 -    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
   13.67 +    SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata;
   13.68      if (!data) { return; }
   13.69 -    SDL_uikitview *view = data->view;
   13.70 +    SDL_uikitview *view = data.view;
   13.71      if (!view) { return; }
   13.72 -    
   13.73 +
   13.74      SDL_Rect r = view.textInputRect;
   13.75      int height = view.keyboardHeight;
   13.76      int offsetx = 0;
    14.1 --- a/src/video/uikit/SDL_uikitwindow.h	Wed Aug 06 00:45:11 2014 -0300
    14.2 +++ b/src/video/uikit/SDL_uikitwindow.h	Wed Aug 06 03:24:16 2014 -0300
    14.3 @@ -26,8 +26,6 @@
    14.4  #import "SDL_uikitopenglview.h"
    14.5  #import "SDL_uikitviewcontroller.h"
    14.6  
    14.7 -typedef struct SDL_WindowData SDL_WindowData;
    14.8 -
    14.9  extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
   14.10  extern void UIKit_ShowWindow(_THIS, SDL_Window * window);
   14.11  extern void UIKit_HideWindow(_THIS, SDL_Window * window);
   14.12 @@ -44,12 +42,13 @@
   14.13  
   14.14  @end
   14.15  
   14.16 -struct SDL_WindowData
   14.17 -{
   14.18 -    SDL_uikitwindow *uiwindow;
   14.19 -    SDL_uikitopenglview *view;
   14.20 -    SDL_uikitviewcontroller *viewcontroller;
   14.21 -};
   14.22 +@interface SDL_WindowData : NSObject
   14.23 +
   14.24 +@property (nonatomic, strong) SDL_uikitwindow *uiwindow;
   14.25 +@property (nonatomic, strong) SDL_uikitopenglview *view;
   14.26 +@property (nonatomic, strong) SDL_uikitviewcontroller *viewcontroller;
   14.27 +
   14.28 +@end
   14.29  
   14.30  #endif /* _SDL_uikitwindow_h */
   14.31  
    15.1 --- a/src/video/uikit/SDL_uikitwindow.m	Wed Aug 06 00:45:11 2014 -0300
    15.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Wed Aug 06 03:24:16 2014 -0300
    15.3 @@ -56,35 +56,41 @@
    15.4  
    15.5  @end
    15.6  
    15.7 +@implementation SDL_WindowData
    15.8 +
    15.9 +@synthesize uiwindow;
   15.10 +@synthesize view;
   15.11 +@synthesize viewcontroller;
   15.12 +
   15.13 +@end
   15.14 +
   15.15  
   15.16  static int SetupWindowData(_THIS, SDL_Window *window, SDL_uikitwindow *uiwindow, SDL_bool created)
   15.17  {
   15.18      SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
   15.19 -    SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
   15.20 -    SDL_WindowData *data;
   15.21 +    SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata;
   15.22  
   15.23      /* Allocate the window data */
   15.24 -    data = (SDL_WindowData *)SDL_malloc(sizeof(*data));
   15.25 +    SDL_WindowData *data = [[SDL_WindowData alloc] init];
   15.26      if (!data) {
   15.27          return SDL_OutOfMemory();
   15.28      }
   15.29 -    data->uiwindow = uiwindow;
   15.30 -    data->viewcontroller = nil;
   15.31 -    data->view = nil;
   15.32 +
   15.33 +    data.uiwindow = uiwindow;
   15.34  
   15.35      /* Fill in the SDL window with the window data */
   15.36      {
   15.37          window->x = 0;
   15.38          window->y = 0;
   15.39  
   15.40 -        CGRect frame = UIKit_ComputeViewFrame(window, displaydata->uiscreen);
   15.41 +        CGRect frame = UIKit_ComputeViewFrame(window, displaydata.uiscreen);
   15.42  
   15.43          /* Get frame dimensions */
   15.44          int width = (int) frame.size.width;
   15.45          int height = (int) frame.size.height;
   15.46  
   15.47          /* Make sure the width/height are oriented correctly */
   15.48 -        if (UIKit_IsDisplayLandscape(displaydata->uiscreen) != (width > height)) {
   15.49 +        if (UIKit_IsDisplayLandscape(displaydata.uiscreen) != (width > height)) {
   15.50              int temp = width;
   15.51              width = height;
   15.52              height = temp;
   15.53 @@ -94,7 +100,7 @@
   15.54          window->h = height;
   15.55      }
   15.56  
   15.57 -    window->driverdata = data;
   15.58 +    window->driverdata = (void *) CFBridgingRetain(data);
   15.59  
   15.60      /* only one window on iOS, always shown */
   15.61      window->flags &= ~SDL_WINDOW_HIDDEN;
   15.62 @@ -103,7 +109,7 @@
   15.63       * This is only set if the window is on the main screen. Other screens
   15.64       *  just force the window to have the borderless flag.
   15.65       */
   15.66 -    if (displaydata->uiscreen == [UIScreen mainScreen]) {
   15.67 +    if (displaydata.uiscreen == [UIScreen mainScreen]) {
   15.68          window->flags |= SDL_WINDOW_INPUT_FOCUS;  /* always has input focus */
   15.69  
   15.70          /* This was setup earlier for our window, and in iOS 7 is controlled by the view, not the application
   15.71 @@ -123,8 +129,8 @@
   15.72       * device orientation changes. This will trigger resize events, if
   15.73       * appropriate.
   15.74       */
   15.75 -    data->viewcontroller = [[SDL_uikitviewcontroller alloc] initWithSDLWindow:window];
   15.76 -    [data->viewcontroller setTitle:@"SDL App"];  /* !!! FIXME: hook up SDL_SetWindowTitle() */
   15.77 +    data.viewcontroller = [[SDL_uikitviewcontroller alloc] initWithSDLWindow:window];
   15.78 +    data.viewcontroller.title = @"SDL App";  /* !!! FIXME: hook up SDL_SetWindowTitle() */
   15.79  
   15.80      return 0;
   15.81  }
   15.82 @@ -134,9 +140,9 @@
   15.83  {
   15.84      @autoreleasepool {
   15.85          SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
   15.86 -        SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
   15.87 -        const BOOL external = ([UIScreen mainScreen] != data->uiscreen);
   15.88 -        const CGSize origsize = [[data->uiscreen currentMode] size];
   15.89 +        SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;
   15.90 +        const BOOL external = ([UIScreen mainScreen] != data.uiscreen);
   15.91 +        const CGSize origsize = [[data.uiscreen currentMode] size];
   15.92  
   15.93          /* SDL currently puts this window at the start of display's linked list. We rely on this. */
   15.94          SDL_assert(_this->windows == window);
   15.95 @@ -164,8 +170,8 @@
   15.96              }
   15.97  
   15.98              if (bestmode) {
   15.99 -                SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)bestmode->driverdata;
  15.100 -                [data->uiscreen setCurrentMode:modedata->uiscreenmode];
  15.101 +                SDL_DisplayModeData *modedata = (__bridge SDL_DisplayModeData *)bestmode->driverdata;
  15.102 +                [data.uiscreen setCurrentMode:modedata.uiscreenmode];
  15.103  
  15.104                  /* desktop_mode doesn't change here (the higher level will
  15.105                   * use it to set all the screens back to their defaults
  15.106 @@ -175,7 +181,7 @@
  15.107              }
  15.108          }
  15.109  
  15.110 -        if (data->uiscreen == [UIScreen mainScreen]) {
  15.111 +        if (data.uiscreen == [UIScreen mainScreen]) {
  15.112              if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_BORDERLESS)) {
  15.113                  [UIApplication sharedApplication].statusBarHidden = YES;
  15.114              } else {
  15.115 @@ -185,11 +191,11 @@
  15.116  
  15.117          if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
  15.118              if (window->w > window->h) {
  15.119 -                if (!UIKit_IsDisplayLandscape(data->uiscreen)) {
  15.120 +                if (!UIKit_IsDisplayLandscape(data.uiscreen)) {
  15.121                      [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
  15.122                  }
  15.123              } else if (window->w < window->h) {
  15.124 -                if (UIKit_IsDisplayLandscape(data->uiscreen)) {
  15.125 +                if (UIKit_IsDisplayLandscape(data.uiscreen)) {
  15.126                      [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
  15.127                  }
  15.128              }
  15.129 @@ -197,7 +203,7 @@
  15.130  
  15.131          /* ignore the size user requested, and make a fullscreen window */
  15.132          /* !!! FIXME: can we have a smaller view? */
  15.133 -        SDL_uikitwindow *uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data->uiscreen.bounds];
  15.134 +        SDL_uikitwindow *uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds];
  15.135  
  15.136          /* put the window on an external display if appropriate. This implicitly
  15.137           * does [uiwindow setframe:[uiscreen bounds]], so don't do it on the
  15.138 @@ -205,13 +211,13 @@
  15.139           * status bar real estate.
  15.140           */
  15.141          if (external) {
  15.142 -            [uiwindow setScreen:data->uiscreen];
  15.143 +            [uiwindow setScreen:data.uiscreen];
  15.144          }
  15.145  
  15.146          if (SetupWindowData(_this, window, uiwindow, SDL_TRUE) < 0) {
  15.147 -            [uiwindow release];
  15.148              return -1;
  15.149          }
  15.150 +
  15.151      }
  15.152  
  15.153      return 1;
  15.154 @@ -221,7 +227,7 @@
  15.155  UIKit_ShowWindow(_THIS, SDL_Window * window)
  15.156  {
  15.157      @autoreleasepool {
  15.158 -        UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
  15.159 +        UIWindow *uiwindow = ((__bridge SDL_WindowData *) window->driverdata).uiwindow;
  15.160  
  15.161          [uiwindow makeKeyAndVisible];
  15.162      }
  15.163 @@ -231,7 +237,7 @@
  15.164  UIKit_HideWindow(_THIS, SDL_Window * window)
  15.165  {
  15.166      @autoreleasepool {
  15.167 -        UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
  15.168 +        UIWindow *uiwindow = ((__bridge SDL_WindowData *) window->driverdata).uiwindow;
  15.169  
  15.170          uiwindow.hidden = YES;
  15.171      }
  15.172 @@ -251,11 +257,11 @@
  15.173  static void
  15.174  UIKit_UpdateWindowBorder(_THIS, SDL_Window * window)
  15.175  {
  15.176 -    SDL_WindowData *windowdata = (SDL_WindowData *) window->driverdata;
  15.177 -    SDL_uikitviewcontroller *viewcontroller = windowdata->viewcontroller;
  15.178 +    SDL_WindowData *windowdata = (__bridge SDL_WindowData *) window->driverdata;
  15.179 +    SDL_uikitviewcontroller *viewcontroller = windowdata.viewcontroller;
  15.180      CGRect frame;
  15.181  
  15.182 -    if (windowdata->uiwindow.screen == [UIScreen mainScreen]) {
  15.183 +    if (windowdata.uiwindow.screen == [UIScreen mainScreen]) {
  15.184          if (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS)) {
  15.185              [UIApplication sharedApplication].statusBarHidden = YES;
  15.186          } else {
  15.187 @@ -269,11 +275,11 @@
  15.188      }
  15.189  
  15.190      /* Update the view's frame to account for the status bar change. */
  15.191 -    frame = UIKit_ComputeViewFrame(window, windowdata->uiwindow.screen);
  15.192 +    frame = UIKit_ComputeViewFrame(window, windowdata.uiwindow.screen);
  15.193  
  15.194 -    windowdata->view.frame = frame;
  15.195 -    [windowdata->view setNeedsLayout];
  15.196 -    [windowdata->view layoutIfNeeded];
  15.197 +    windowdata.view.frame = frame;
  15.198 +    [windowdata.view setNeedsLayout];
  15.199 +    [windowdata.view layoutIfNeeded];
  15.200  
  15.201      /* Get frame dimensions */
  15.202      int width  = (int) frame.size.width;
  15.203 @@ -308,13 +314,9 @@
  15.204  void
  15.205  UIKit_DestroyWindow(_THIS, SDL_Window * window)
  15.206  {
  15.207 -    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
  15.208 -
  15.209      @autoreleasepool {
  15.210 -        if (data) {
  15.211 -            [data->viewcontroller release];
  15.212 -            [data->uiwindow release];
  15.213 -            SDL_free(data);
  15.214 +        if (window->driverdata != NULL) {
  15.215 +            CFRelease(window->driverdata);
  15.216          }
  15.217      }
  15.218  
  15.219 @@ -325,7 +327,7 @@
  15.220  UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
  15.221  {
  15.222      @autoreleasepool {
  15.223 -        UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
  15.224 +        UIWindow *uiwindow = ((__bridge SDL_WindowData *) window->driverdata).uiwindow;
  15.225  
  15.226          if (info->version.major <= SDL_MAJOR_VERSION) {
  15.227              info->subsystem = SDL_SYSWM_UIKIT;
  15.228 @@ -342,14 +344,14 @@
  15.229  int
  15.230  SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam)
  15.231  {
  15.232 -    SDL_WindowData *data = window ? (SDL_WindowData *)window->driverdata : NULL;
  15.233 +    @autoreleasepool {
  15.234 +        SDL_WindowData *data = window ? (__bridge SDL_WindowData *)window->driverdata : nil;
  15.235  
  15.236 -    if (!data || !data->view) {
  15.237 -        return SDL_SetError("Invalid window or view not set");
  15.238 -    }
  15.239 +        if (!data || !data.view) {
  15.240 +            return SDL_SetError("Invalid window or view not set");
  15.241 +        }
  15.242  
  15.243 -    @autoreleasepool {
  15.244 -        [data->view setAnimationCallback:interval callback:callback callbackParam:callbackParam];
  15.245 +        [data.view setAnimationCallback:interval callback:callback callbackParam:callbackParam];
  15.246      }
  15.247  
  15.248      return 0;