Re: Bundle, Wrappers, whatever
Re: Bundle, Wrappers, whatever
- Subject: Re: Bundle, Wrappers, whatever
- From: Douglas Davidson <email@hidden>
- Date: Wed, 13 Mar 2002 11:13:30 -0800
On Tuesday, March 12, 2002, at 06:37 PM, Sam Goldman wrote:
I know that .rtfd files and .app applications are actually folders
containing other files, but how do I implement my own file. Would that
be a
bundle? The term in its non-programmatic sense would be correct...
We try to distinguish terminologically between "bundles" and
"packages". A bundle (in our sense) is something that has one of the
special structures recognized by CFBundle/NSBundle. A "package" is a
directory that is presented to the user as a single object. For
example, bundled applications are both bundles and packages; frameworks
are bundles but not packages; rtfd's are packages but not bundles; and
ordinary directories are neither.
For your purposes, i.e. creating a document composed of multiple files,
what you want is a package. Whether your packages are also structured
as bundles or not is your choice; you might choose to structure them as
bundles if you wanted to use some of the features of CFBundle/NSBundle,
such as the automatic selection of localizations. For the most part,
though, this is overkill for documents; typically an unstructured or
minimally structured directory is sufficient. In either case, the main
class in Cocoa for dealing with packages is NSFileWrapper; see the
NSFileWrapper documentation for more information.
The other part of the equation is making sure that your packages are
recognized as such by Launch Services and the Finder. There are several
ways to do this, but one thing you will want to do is to give them an
appropriate extension and have your application claim that extension in
its Info.plist. This is all pretty extensively documented, and there
are a host of examples.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.