0

I tried putting all xib files together in a folder in my project. And then I add this folder into the Xcode project, Hoping that Xcode may recognized them and put them in the directory I want in target package.

But when I ran the target, the console(NSLog) told me that the nib file could not be found.

I looked into the directory, there are xib files there instead of nib file.

Here comes the question mentioned in the title. Can I achieve that?


Here is the scene:

I built the project. Then Xcode convert xib files into nib ones then put them in the "Resources" directory. As all resource files (including these nib files) are put together under this folder, it looks messy.

What I wanted to do is put all these resource in different folder automatically after the building was done. What should I do?

Andrew Chang
  • 1,289
  • 1
  • 18
  • 38

2 Answers2

1

I don't think there is a way this is possible, except in localization (see auto-created folder structure): https://developer.apple.com/library/mac/documentation/corefoundation/conceptual/cfbundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW7

Jeremiah Smith
  • 740
  • 6
  • 17
0

Try doing this:

  1. select all of the XIB files
  2. change the file type to something else
  3. then set the file type BACK to the default type (IB CocoaTouch XIB)
  4. de-select all of the files
  5. clean the project, delete the previous version(s) from the simulator(s)
  6. build the project

now it should contain contain only NIBs, no XIBs.

Cocoa Puffs
  • 724
  • 2
  • 8
  • 16
  • Wow, that was too complicated. I have an idea: add a shell command to move("mv" command) all nib files to the directory I specified as soon as build success. But I do not know how to use command line tool... :( – Andrew Chang Dec 12 '13 at 06:17
  • @AndrewChang - well isn't the problem you don't have the .nib files, but instead .xib; how would you move what you don't have? – Cocoa Puffs Dec 12 '13 at 07:02
  • Nope. Sorry for my bad description. I have updated my question. Is it clearer? – Andrew Chang Dec 12 '13 at 09:00
  • 1
    @AndrewChang, oh now you tell me! [this answer](http://stackoverflow.com/a/4425148/1204467) looks to be what you're looking to do i think. – Cocoa Puffs Dec 12 '13 at 11:46
  • If I am not mistaken, the answer you posted was talking about organizing file in PROJECT instead of built target package. But still, it helps, in another field. – Andrew Chang Dec 13 '13 at 00:29