Can I put all nib files together in another folder in target application package?

大城市里の小女人 提交于 2019-12-25 09:34:09

问题


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?


回答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




回答2:


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.



来源:https://stackoverflow.com/questions/20533227/can-i-put-all-nib-files-together-in-another-folder-in-target-application-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!