How can I write bundles in Cocoa without much "fuzz" around it? I just want to have a bundle with an Info.plist, a Contents Folder and that folder should contain a couple of files.
A:
Then just make one:
mkdir My.bundle
cd My.bundle
mkdir Contents
cd Contents
touch Info.plist
mkdir Resources
open Info.plist
That should get you started nicely.
Edit: You run this in Terminal.app, of course.
Williham Totland
2010-03-22 14:14:10
Is there a cocoa-only way of doing this, one that uses Cocoa Classes , if possible?
Tristan Seifert
2010-03-22 14:17:52
+3
A:
If you are simply looking to create directories with Cocoa, check out NSFileManager. It has the method:
-createDirectoryAtPath:withIntermediateDirectories:attributes:error:
I also assume that you have read - Bundle Programming Guide
This guide will provide you with the complete anatomy of a bundle.
ericgorr
2010-03-22 14:32:57
+1
A:
You can also use file wrappers, assuming you're using Cocoa and not Cocoa Touch.
Create the bundle out of file wrappers from the inside out, with every directory and file being modeled by a file wrapper. Then, write the outermost file wrapper to the bundle URL.
Peter Hosey
2010-03-22 16:22:18