Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 Beta 6 CUICatalog: Invalid asset name supplied: (null), or invalid scale factor: 2.000000

Tags:

xcode

ios

I'm getting the following errors:

CUICatalog: Invalid asset name supplied: (null), or invalid scale factor: 2.000000
Could not load the "(null)" image referenced from a nib in the bundle with identifier "com.example.project"

I' m getting the errors since I set a "Selected Image" for a Tab Bar Item in Interface Builder:

enter image description here

I've added the file into Xcode:

enter image description here

The setting is written into the storyboard file:

<tabBarItem key="tabBarItem" title="..." image="config.png" selectedImage="config_filled.png" id="5Wh-7m-Y4H"/>

I'm using Xcode 6 Beta 6

I know about Error: CUICatalog: Invalid asset name supplied: (null), or invalid scale factor : 2.000000 but that doesn't help me.

What could cause that the asset name is null? I've reentered the image name, I also tried with cleaning and rebuilding but the error stays (and no image appears)

like image 570
idmean Avatar asked Sep 01 '14 20:09

idmean


4 Answers

In Xcode 6.1, some attributes in Attributes Inspector did not work, but you can use "User Defined Runtime Attributes" to solve this problem.

I solve it like this: enter image description here

like image 174
Mornirch Avatar answered Nov 09 '22 14:11

Mornirch


I've finally ended up using this nasty code in AppDelegate:

UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
((UITabBarItem *)tabBarController.tabBar.items[0]).selectedImage = [UIImage imageNamed:@"light_filled"];
((UITabBarItem *)tabBarController.tabBar.items[1]).selectedImage = [UIImage imageNamed:@"umbrella_filled"];
((UITabBarItem *)tabBarController.tabBar.items[2]).selectedImage = [UIImage imageNamed:@"config_filled"];

Hopefully Apple will fix this bug soon.

like image 43
idmean Avatar answered Nov 09 '22 14:11

idmean


Leave the "Selected Image" for a Tab Bar Item in Interface Builder empty should remove the warning message.

like image 5
NEO Avatar answered Nov 09 '22 15:11

NEO


For me the solution was to check all your UIImageViews in story, sometimes if you delete UIImageview and restore them with Cmd+z, the image in the UIImageView becomes "Unknown". I think it is a bug, since you can still see the image in the storyboard.

Solution: Select the image again in the UIImageView in storyboard

like image 1
Ruud Visser Avatar answered Nov 09 '22 14:11

Ruud Visser