Asset Catalog not being used in project

2020-07-06 04:24发布

问题:

I have a project using an asset catalog and recently without any change on my part, the images are just not displaying. It displays this error:

2014-06-23 21:41:02.824 Project[8247:464100] CUICatalog: Can't find rendition for name: menu scale factor: 2 device idiom: 1 device subtype: 568
2014-06-23 21:41:02.825 Project[8247:464100] Could not load the "image" image referenced from a nib in the bundle with identifier "com.sieradzki.Project"

I know this has already been answered here: Asset Catalog Error: CUICatalog: Can't find rendition for name but the solution to that was with Cocoapods, but I don't use Cocoapods on my project at all and I don't even have it installed on my Mac.

回答1:

I've had this happen to me in the past, and it's always been because I have the Image Set set to "Device Specific" instead of "Universal" when using an image for iPhone and iPad.

For example, if you're using "~iphone" in the name and dragging into the assets catalog, it'll automatically get set as "Device Specific" with "iPhone" selected. Then when you load on iPad it may grab that image still (since that's Xcode's best guess at what you want), but give a warning saying it couldn't find an iPad one. Switching the image set to universal fixes the issue.

I'm willing to bet you have the exact same issue, but you did it with "~ipad".