Re: FileWrappers
Re: FileWrappers
- Subject: Re: FileWrappers
- From: April Gendill <email@hidden>
- Date: Sat, 17 Jan 2004 11:44:33 -0700
On Jan 17, 2004, at 9:24 AM, Rainer Brockerhoff wrote:
From: April Gendill <email@hidden>
Date: Sat, 17 Jan 2004 01:41:53 -0700
I have been looking at some of the file packages here and there and
have come to the conclusion I don't understand how they work. So... I
examined the code for textedit but it only deals with rtfd which
really
does not help. I've looked on Apple's site but other than the docs
which are less informative than the header files there was no info I
could find.
What I am working on has three different files that it uses and for a
part of it all three are used, and I would like to use a package file
to handle this but I cannot seem to find any useful information or
even
a simple example. In the docs it talks about dictionaries and such but
I don't see any .dict or other similar files in the package (using
terminal ls -a) thus the data is obviously stored elsewhere. Where can
I find something either laid out for those of us less informed in
cocoa
or some examples that create their own packages for an idea of how
this
is done. My structure is simple really, 1 array of items that is
actually the master list, one array that is dormant and 1 that is
currently being worked with.
As has been explained elsewhere, you need to declare your file
extension with the LSTypeIsPackage key set to YES in the
CFBundleDocumentTypes list. When creating a file package, create a
folder with that file extension, and inside that there's no set
format. So you can create several files inside the folder, and handle
them as you wish.
So if I had asked my second question "What if I just make a folder
with an extension and..." I'd have been on the right track.
I also recommend setting the folder's package flag (which for folders
has the same value as kHasBundle in <Finder.h>), this is honored in
Mac OS 9 and (at least
Which is basically done the same way you set any other attribute for a
folder or file when you create it I assume.
for now) in Mac OS X, too.
So inside your package folder you could have a .plist file with the
index arrays, or dictionaries, or whatever, and any number of other
files.
HTH,
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"It's extremely unlucky to be superstitious, for no other reason
than it is always unlucky to be colossally stupid." (Stephen Fry)
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
_______________________________________________
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.