Re: Property List Question
Re: Property List Question
- Subject: Re: Property List Question
- From: Deirdre Saoirse Moen <email@hidden>
- Date: Fri, 18 May 2001 03:44:39 -0700
The other more subtle issue that plists allow you to address more
readily (and Sketch's example in particular shows) is that you have
more flexibility to allow for backwards compatibility.
After I got my app reading and writing from/to a binary format, I
decided to cough up a plist format for the data. I couldn't find one
in the Cocoa stuff and I needed something that would be flexible
(since my app design isn't set yet, thus the document format needs to
be fluid). So, I wrapped the CF stuff that I used. Besides, such
heavy C coding was giving me a headache. :)
Ghods C is verbose. I almost forgot.
Since Objective-C's mixin format is a protocol, that's how I made it
work; I added the protocol to my document class. Le voila, we have
plists -- and I can add them to any other part of my project for free.
I'll post it in a couple days -- I haven't fully tested all the read
functions, but it has the standard StephDisclaimer(tm): "It worked
when *I* used it!"
One quirk though -- I wasn't sure quite what to do with the files in
PB. If I included them, it wanted to compile them separately.
However, their inclusion in the document class seemed only to work if
I included the .m file in the body of my NSDocument subclass (one of
those really awful tricks of C coders, I'm afraid). That means that I
had to make it so it wasn't a class on its own. Which means that PB
harfs when it sees the standalone.
Dunno quite what to do about that yet, but it's way way way past my
bedtime. I usually solve these problems when I wake up.... :)
--
_Deirdre Stash-o-Matic:
http://weirdre.com http://deirdre.net
Macintosh Developer (seeking work): Will work for Cocoa
"I love deadlines. I like the whooshing sound they make as they fly by."
- Douglas Adams