How to debug CUICatalog: Invalid asset name supplied: (null)

白昼怎懂夜的黑 提交于 2019-12-23 10:42:08

问题


I am using xib to make UI of one of my apps. I am getting several warnings in console related to "CUICatalog: Invalid asset name supplied: (null)". From research I got to know that if we supply wrong image name in xib this error occurs. But here I want to know if there is any way to point the place from where its throwing that error, xib name or wrong image name etc.


回答1:


I have just fixed this error. Just Check the usage of function [UIImage imageNamed:(NSString*) imageName]. If the imageName is nil, then error happens.

In my code:

UIImageView*imageView=[[UIImageView alloc]initWithFrame:frame];

    if (imageName!=nil) {
        imageView.image=[UIImage imageNamed:imageName];
    }


来源:https://stackoverflow.com/questions/26496089/how-to-debug-cuicatalog-invalid-asset-name-supplied-null

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!