In iOS 4.0 and later, it is possible to mark individual resource files as usable only on a specific type of device.This capability simplifies the code you have to write for Universal applications. Rather than creating separate code paths to load one version of a resource file for iPhone and a different version of the file for iPad, you can let the bundle-loading routines choose the correct file. All you have to do is name your resource files appropriately.
<basename> <device> .<filename_extension>
The <basename> string represents the original name of the resource file. It also represents the name you use when accessing the file from your code. Similarly, the <filename_extension> string is the standard filename extension used to identify the type of the file. The <device> string is a case-sensitive string that can be one of the following values:
~ipad - The resource should be loaded on iPad devices only.
~iphone - The resource should be loaded on iPhone or iPod touch devices only.
You can apply device modifiers to any type of resource file. For example, suppose you have an image namedMyImage.png. To specify different versions of the image for iPad and iPhone, you would create resource fileswith the names MyImage~ipad.png and MyImage~iphone.png and include them both in your bundle. Toload the image, you would continue to refer to the resource as MyImage.png in your code and let the systemchoose the appropriate version, as shown here:
<span style="font-size:18px;">UIImage* anImage = [UIImage imageNamed:@"MyImage.png"];</span>
On an iPhone or iPod touch device, the system loads the MyImage~iphone.png resource file, while on iPad,it loads the MyImage~ipad.png resource file. If a device-specific version of a resource is not found, the systemfalls back to looking for a resource with the original filename, which in the preceding example would be animage named MyImage.png.