Error: CUICatalog: Invalid asset name supplied: (null), or invalid scale factor : 2.000000

Solution 1:

This one appears when someone is trying to put nil in [UIImage imageNamed:]

Add symbolic breakpoint for [UIImage imageNamed:]Symbolic breakpoint example

Add $arg3 == nil condition on Simulator, $r0 == nil condition on 32-bit iPhone, or $x2 == nil on 64-bit iPhone.

Run your application and see where debugger will stop.

P.S. Keep in mind this also happens if image name is empty string. You can check this by adding [(NSString*)$x2 length] == 0 to the condition.

Solution 2:

This error (usually) happens when you try to load an image with [UIImage imageNamed:myImage] but iOS is not sure if myImage is really a NSString and then you have this warning.

You can fix this using:

[UIImage imageNamed:[NSString stringWithFormat:@"%@", myImage]]

Or you can simply check for the length of the name of the UIImage:

if (myImage && [myImage length]) {

    [UIImage imageNamed:myImage];
}