I've got an image assets catalog in Xcode 5 and two images in it.
This is what the folder structure looks like
This is the contents of the json file:
{
"images" : [
{
"idiom" : "ipad",
"scale" : "1x",
"filename" : "background.png"
},
{
"idiom" : "ipad",
"scale" : "2x",
"filename" : "background@2x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
The assets catalog is the only place where I have the background and a file that's named background.png. Now whenever I do a
[UIImage imageNamed:@"background"];
On a non retina iPad I get the non retina version and on a retina iPad I get the non retina version again. I use this technique with all of my other resources as well and it correctly loads the right image for retina/non retina everywhere, except for this one.
If I do
[UIImage imageNamed:@"background@2x"]
it loads the retina version of the image and at this point the only solution that I see is to just check the scale and load the appropriate image, but I'd really like this to work.
Any ideas?
Edit:
Here's a link to a sample project, showing the issue AssetsCatalogWrongImageLoad
Edit 2 Seems like it doesn't have anything to do with the asset catalog. [UIImage imageNamed] just doesn't work with these two images, even if they are on their own...