IPad 3 Retina Display, @ 2x images and apps are already in store

Thus, some iPads in the future are likely to have a Retina Display. And Apple is likely going to stick with the @ 2x paradigm . I have been expecting this for a while, and so I already have @ 2x work for the iPad in my applications; some of them are already in the app store.

My question is this: will I need to recompile and / or resubmit applications in order to use these works when this mythical iPad is released in order to use these files? Or is it something baked into the OS itself, and it should just use them automatically?

(Since the same thing happened earlier, what happened to applications released under the SDK before iPhone4 that had the correct design? Did they just work?)

+7
source share
3 answers

I experimented with the retina iPad today, and here is what seems to be happening:

  • If the application was compiled with the fairly recent Xcode (possibly 4.2+), @ 2x images are used, as and when the iPhone 4 came out.
  • If the application was compiled with Xcode 3, the @ 2x images have no , even if they are present. (for example, in an iphone-4 hybrid app).

(We have a number of projects based on Xcode-3, many of which are hybrid for the iPhone retina. None of them used @ 2x graphics on the new ipad. When I compiled a test project in both Xcode 3 and Xcode 4, assembly 4 used the retina resource and didn’t do assembly 3. Further experiments showed that the difference was compiled into the executable file itself, so this is not just setting info.plastic, as I had hoped.)

[eta: my hypothesis is that compiling with an earlier SDK links you to another version of UIKit at runtime. Strange differences in behavior, as I update our code, it seems to confirm this. If someone knows the spell, to know for sure, comment.]

[edited to add, again: there is also nib difference there. An old project opened in xcode 4 will not use @ 2x graphics until I save my MainWindow.nib file; then this happened everywhere, without any other changes. I suspect a hidden property of the UIWindow object.]

+6
source

What I found when creating with Xcode 4.2 (iOS SDK 5.0) on Snow Leopard:

Images downloaded programmatically using [UIImage imagedNamed:] in your code will correctly load retina images @ 2x on the iPad retina.

Images indicated on buttons and views in XIB Interface Builder files usually DO NOT properly load retina images @ 2x.

The workaround I discovered is to force UIImage to cache each of the images mentioned in your XIB by calling [UIImage imagedNamed:] in your view controller (or corresponding) initWithNibName: (NSString *) bundle: (NSBundle *). The software method provides a good @ 2x load, and the system caches it, and the XIB loading mechanism ends with a link, which gives retinal images. For example:

// The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Doing this to precache proper retina versions, because older xcode nibs aren't loading them correctly on retina iPads with XCode 4.2 builds [UIImage imageNamed:@"my_button.png"]; [UIImage imageNamed:@"my_other_button.png"]; } return self; } 

I assume that creating with Xcode 4.3 (SDK 5.1) works correctly with XIB, but I was not ready to upgrade to Lion just to use this version of Xcode.

+2
source

I guess this will just work on the device. I understand that [UIImage imageNamed:] is looking for @ 2x if the device supports it. Therefore, it seems to be embedded in iOS. This is just a hunch.

+1
source

All Articles