iphone - iOS 4.0 contentScaleFactor and scale - how to handle in 3.1.3? -
i tasked making app works in ios 4.0 work in 3.1.3 , 3.2 again. straightforward handling of new api scale , other situations values must passed/returned hard.
respondstoselector/performselector takes care of else.
here's simplified version of going on:
-(float)getimagescalefactor { if([[uiscreen mainscreen] scale == 2.0) return kscalefactorforretinadisplay; else return kscalefactorforolderdisplay; }
scale isn't in ios prior 4.0.
can show code sample work in versions of ios?
i use similar code, you're missing 1 important part: respondstoselector:
if([[uiscreen mainscreen] respondstoselector:@selector(scale)] && [uiscreen mainscreen].scale == 2.0f) return kscalefactorforretinadisplay; else return kscalefactorforolderdisplay;
Comments
Post a Comment