Question

I am trying to update my app to support retina displays but when it runs on a Retina MacBook Pro the @2x versions of the images aren't being used. Below are the methods I'm using in my app to set the image views.

In the XML parser class:

[[self theCurrent] setCurIcon:[NSImage imageNamed:@"snow.png"]];

Setting the NSImageView in the Current class:

[viewCurIcon setImage:curIcon];

Each image file has a standard res version and a high res version which are all in the supporting files folder of the Xcode project:

snow.png is 128x128 pixels
snow@2x.png is 256x256 pixels

I confirmed that the @2x versions are included in the app package when Xcode builds the application. Other things to note are: the app is a menu bar application with all the views inside an NSPopover, an animated GIF is used in one of the image views (no @2x version of the GIF), the app is built with Xcode 4.4 on an older MacBook Pro running OSX 10.7.4 with no retina display.

Was it helpful?

Solution

Try using @"snow" instead of @"snow.png". This way you are pointing to an image named "snow" and letting the OS sort out the details regarding resolution and extension rather than specifically stating the image will be named "snow.png"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top