[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keyed Archiving and MOSX compatibility...

From: Richard Frith-Macdonald
Subject: Re: Keyed Archiving and MOSX compatibility...
Date: Fri, 26 Mar 2004 06:40:03 +0000

On 25 Mar 2004, at 23:50, Gregory John Casamento wrote:

--- Nicola Pero <address@hidden> wrote:

The programmer can decide which information is essential and which is
not, which is something a machine can't do.

If you want to keep a fixed background color on all platforms, maybe
because yours is a yellow post-it application and you want all
windows to have a yellow background, you can do it.

If you just want to create a window with a standard background, you
don't put the background color in the file.


Do you store the background color of windows ?  If yes, you are
storing a platform-specific detail in the file.  If not, you are not
giving to the programmer the possibility of forcing a special
background color for his/her windows.

I just did snip out these two sections of your posting as they point to an interesting point in the Apple keyed encoding NIB files. The standard
answer to your question would of course be to store the named colour
system/windowbackground to handle this special case. But interestingly
this is not what Apple does most of the times. They seem to have a
clever algorithm to decide what to put into the NIB file and what to
leave out. Fields that have their standard values are normally not
encoded at all, so on a different target machine the default values
there will be used. This concept works for a lot more things than just
colours and fonts, which we could easyly handle specifically. If you
look through an XML NIB file you will see that only a minimal set of
attributes for each object are stored.

Thanks.  Interesting.  I'll indeed have a deeper look. :-)

This is an extremely interesting point, indeed. :)

Apple actually have some quite nice documentation on how keyed archiving
should be used, suggesting encoding the minimal set of values and writing decoders capable of using whatever values they find in the archive (mostly
with a view to maintaining forward and backward compatibility).
Check the keyed coding and keyed archiving links off this page - index.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]