There are several answers on SO already about "imageNamed:" not working, but none have included my particular wrinkle:
I'm getting nil
from "imageNamed:" on iOS 7, but the same build works on iOS 8.
Obviously, everything is hooked up properly because it does work on iOS 8, but it consistently returns nil
for a wide range (maybe 2 dozen) of images on iOS 7. Notably, I moved the assets to an AssetCatalog around the time this started. Is there some unusual behavior of asset catalogs on iOS 7 that has to be accounted for?
Here are some details, based on the answers to similar questions on this site:
- This problem appears in actual builds that are archived and exported for users, as well as in the simulator. Both versions show the iOS 7/8 split in behavior.
- Images are PNGs, and the Asset Catalog contains 1x, 2x, and 3x versions of each.
- I've confirmed the spelling and capitalization matches (further confirmed by it working on iOS 8).
By far the majority of the answers on SO are for bugs that would prevent it from working at all. Can anyone help with an image call that only works on iOS 8?
@3x
won't be found in iOS 7. Are regular assets &@2x
assets not appearing either? – AdamPro13-imageNamed:
? – TimimageNamed:
in iOS 7/8 for an image in asset catalog, it works. Try to make a tiny little project that shows the problem, and post it where we can look at it. – mattnil
for a single file that has 1x, 2x, and 3x versions. – Nerrolken