[SDL] Crash in iPad with iOS 3.2

Eric Wing ewmailing at gmail.com
Fri Jul 1 01:07:19 PDT 2011


I'm speaking from memory at the moment, but I think you want to use
contentScaleFactor exclusively; don't use scale.

Basically:

float my_scale_factor = 1.0;
if([your_ui_view respondsToSelector:@selector(contentScaleFactor)]
{
    my_scale_factor = [your_ui_view contentScaleFactor];

}

-Eric




On Thu, Jun 30, 2011 at 7:07 PM, josebagar <joseba.gar at gmail.com> wrote:

> **
> Hi!
>
> I just found that SDL is crashing in the iPad simulator for iOS 3.2 but not
> for iOS 4.2 or over when compiling with Xcode 4.0.2.
> The Xcode debugger points to line 127 in video/uikit/SDL_uikitopenglview.m
> as the line that triggers the crash.
> On those lines one can find:
>
>
> Code:
>
>
>         /* Use the main screen scale (for retina display support) */
>         if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
>                 self.contentScaleFactor = [UIScreen mainScreen].scale;
>
> I believe the problem to be that -contrarily to what Apple docs appear to
> state- the "scale" selector is supported in iOS 3.2 in the iPad, but
> contentScaleFactor is not.
> I'm no expert in Objective-C, but I believe the following code to be more
> correct (it doesn't crash for me):
>
>
> Code:
>
>
>         /* Use the main screen scale (for retina display support) */
>         if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] &&
> [self respondsToSelector:@selector(contentScaleFactor)])
>                 self.contentScaleFactor = [UIScreen mainScreen].scale;
>
> The same check is being performed in line 155 so I imagine it will crash
> there, too.
>
> I've filed a bug with this same info in Bugzilla:
> http://bugzilla.libsdl.org/show_bug.cgi?id=1239
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>


-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110701/fafcb429/attachment-0007.htm>


More information about the SDL mailing list