iOS Developer Docs Are Incorrect About "@2x" Images
||Date Originated:||22-Jul-2010 09:23 PM|
||Product Version:||Latest at Apple.com|
While discussing the necessary steps to prepare apps for high-resolution displays, Apple's developer documentation makes two incorrect assertions:
(assertion 1) "On devices with high-resolution screens, the imageNamed:, imageWithContentsOfFile:, and initWithContentsOfFile: methods automatically looks for a version of the requested image with the @2x modifier in its name." This is incorrect. initWithContentsOfFile: does *NOT* presently look for an image with an @2x modifier when told to load a given resource, regardless of whether the file extension is present.
(assertion 2) "CFBundleIconFile (String - iOS, Mac OS X) identifies the file containing the icon for the bundle. The filename you specify does not need to include the extension, although it may. The system looks for the icon file in the main resources directory of the bundle." This is incorrect because if the file extension is omitted, Application Loader will reject the binary. Adding the (in my case) .png extension makes the file submission successful.
Steps to Reproduce:
Visit this URL for assertion 1...
And this URL for assertion 2:
I expected my @2x icons and resources to be automatically loaded.
My app was rejected by Application Loader, and the iPhone 4 Simulator is not loading my high-resolution assets.
One odd exception to assertion 1 is that if an @2x resource is explicitly loaded by name in initWithContentsOfFile:, then the resultant UIImage instance will have its scale factor set to 2.0. So, there is obviously some checking being done, but it is neither complete nor correct.
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!