Search code examples
objective-ciosipadxcode4.2retina-display

iPad3 high resolution retina display issue


I am developing an app for iPad3(Retina Display) using Xcode 4.2 [iOS SDK 5.0]. I am using following code snippet for detecting retina (high-resolution) display.

 if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) 
{
NSLog(@"scale = %f",[[UIScreen mainScreen] scale]);
if ([[UIScreen mainScreen] scale] > 1.0) {
    NSLog(@"Retina Display iPad3");
} 
else    
{
    NSLog(@"Non Retina Display iPad 1/2");
}
}

When I install app on iPad3 device it is showing output:

scale = 1.00000;

Non Retina Display iPad 1/2.

Above code is not detecting Retina display.

I've tried all the codes related to retina display detection from google but all codes failed to detect retina display. Is there any method to detect iPad 3 retina display.

Thank you in advance.


Solution

  • For your app to support the new iPad retina display, you need to develop and build against the 5.1 SDK (which I think means you need to use XCode 4.3).