The storyboard has question marks for each image after importing into xcassets

are all the images in my storyboard now? images. This happened after I imported all the media assets into the new .xcassets structure. The application works fine, and the images show when the application starts, but what can I do to restore them to the storyboard?

+7
ios iphone xcode5 xcasset
source share
2 answers

Remove the .png extension from the image names in the storyboard. Xcode5 now uses the image name, not the file name.

+10
source share

It is likely that the accepted answer will solve the problem. However, if you are still scratching your head:

If you have a naming convention for assets that includes "." (for example, "icon.menu.normal.png"), you will find that Xcode and IB will very happily collaborate before using .xcassets. If you then move everything to .xcassets, you will find that all of a sudden:

  • IB will display the images correctly if you leave the file extension. However, when the application starts, none of the IB correctly visible images will be downloaded;
  • If you enable the file extension in IB, IB will display them as broken question marks, but they will display correctly in the application.
  • If you use imageNamed: you will find that you need to enable the file extension for the assets, otherwise you will go to the north.

Decision? Do not use "." in asset naming conventions (bad programmer). Using underscores ("_") works great, is also readable and saves you a lot of trouble.

0
source share

All Articles