Recently, people have been complaining on Twitter that recompilation with iOS 5.1 SDK is required in order to support Retina assets for the new iPad.
While preparing a universal update for my app KaiCards including iPad Retina support, I discovered that there is a good reason for this: If iPad Retina support had been enabled for apps compiled with older SDKs, this would have broken most existing universal apps.
The naming scheme for image resources looks like this:
Image[@2x][~ipad|~iphone].png
Now I would have assumed that the platform (~ipad) takes precedence over the display resolution (@2x), but this is apparently not the case. For some reason, Apple chose to give priority to the display resolution.
If you have an existing universal app with iPhone Retina support, you have probably included the following resources:
Image.png
[email protected]
Image~ipad.png
Now, when running on a Retina iPad, [email protected] will be used instead of Image~ipad.png which can lead to unexpected effects. ;-)
You may argue that I should have added the platform specifier for iPhone, too. This would have avoided the problem:
Image~iphone.png
Image@2x~iphone.png
Image~ipad.png
However, that’s just not what you do when you start out with an iPhone app and add iPad support later on…