Re: Creating a Bundle via Code
Re: Creating a Bundle via Code
- Subject: Re: Creating a Bundle via Code
- From: Ken Thomases <email@hidden>
- Date: Fri, 20 Jun 2008 17:16:36 -0500
On Jun 20, 2008, at 4:43 PM, Grant Limberg wrote:
Is there a way to create a new bundle from in Cocoa?
What I'd like to do is have a bundle in my app's Application Support
folder to store some data generated by the user in my app.
Since it's just data, I think you want a package rather than a bundle,
as such. A package is a directory which the Finder and other system
GUI presents to the user as a file.
Do I simply just create a folder and set a bit on it that the OS
identifies as being a bundle or is there anything else special I
have to do?
Sort of. You don't set a bit on the folder. You declare a document
type in your application's Info.plist. That document type would
specify your custom folder name extension and indicate that it's a
package document type. This informs Launch Services (and the Finder,
which relies on LS) that the folder is a package.
See the Bundle Programming Guide. In particular, see the chapter on
"Document Packages", but don't limit yourself to that chapter.
http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/
http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Concepts/DocumentBundles.html
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden