Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Interface Builder - Moved resources to sub-directory, now IB can't see them!

I had a bunch of images in my Xcode project. They were originally added without choosing "Create Folder References for any added folders". So I removed the references and re-added as per these instructions Include a resource directory hierarchy into app bundle

Unfortunately, Interface Builder will not display any of the images inside that directory. On the project tree the directory comes up with a blue icon and all the files are there!

The file names show in the IB Inspector (i.e. under the 'Image' property), but I get missing image icons for everything located in that directory.

Any ideas how to get the images showing again?

like image 926
pchap10k Avatar asked Dec 05 '22 04:12

pchap10k


1 Answers

Problem solved! Turns out that blue folder references are fine, but IB will not read them! For anyone else who cares to know, if you have the following:

/iphone-project-dir/images/pic.png

Once you've added them in a blue folder in Xcode (as detailed in link above), you can refer to them in IB as follows:

images/pic.png

In the XIB's XML it will look something like this

<string key="NSResourceName">images/pic.png</string>

Simple! The only drawback is Interface Builder's WYSIWYG preview does not process these paths!

I found the answer here http://www.iphonedevsdk.com/forum/iphone-sdk-development/6457-xcode-folder-directories.html

like image 77
pchap10k Avatar answered Dec 27 '22 12:12

pchap10k