Reputation: 7932
I noticed that some XCode projects contain a directory under resources folder named (for ex.) project1.bundle
, this directory contains images and .nib
files (which are not readable like .xib
files). the .bundle
directory does not accept any drag-drop for any file from outside of it:
my questions are:
1) why they use such directory ? why didn't just they place their images and other stuff directly inside the resources folder and use them the usual way ?
2) why did they use .nib
files inside this directory ? why not to use the corresponding .xib
files instead ?
3) how to create .bundle
directories inside Xcode ?
p.s. - every .nib
file in the xx.bundle
directory has its corresponding .xib
file somewhere else in the project, so if there is a file named view1.nib
inside project1.bundle
directory, there is somewhere in the project another file named view.xib
Upvotes: 0
Views: 259
Reputation: 4894
The .bundle folders are directories of external libraries you link your application with. They contain code you can use in your own application in some way. To answer all your questions:
1) The .bundle project is created by someone else. As such, you sometimes are not allowed to incorporate all the code in your own project. You have to add it as a library of code.
2) Nib files are in binary format to protect its contents. As such, you can't open them in Xcode to view the contents of the files (which are probably protected by copyright). It is normal for developers to compile their code before they distribute it, this prevents copycats from stealing their work.
3) To add another .bundle to your application, you can drag and drop the .xcodeproj of that project on your project root in Xcode. Then you can add the project as a dependency of your project under the 'Build phases' tab. The project will then be compiled when you compile your project. Lastly, link your application with the compiled library of the other project by adding it to the 'Link Binary with Libraries' list.
To have others add your project as a dependency, just send them the complete folder of your project. They can use the method above to add your project to theirs.
Hope this helps.
Upvotes: 1