Re: Persistance
Re: Persistance
- Subject: Re: Persistance
- From: "Erik M. Buck" <email@hidden>
- Date: Tue, 9 Oct 2001 18:58:40 -0500
>
Nice. Did you manage to get the conditional encoding without having to
>
go through the encoding-cycle twice?
Only one pass is needed. Also, each object occures in the output at most
one time no matter how many times it was encoded. Pointers are
automatically fixed up during decoding and it only takes one pass.
>
>
> The one thing I don't have is a way to integrate property
>
> coding with NSCoding since NSCoding does not accept a "name" argument
>
> needed
>
> to label the properties.
>
>
I would suggest using the NSCoding extensions and Macros provided with
>
MPWFoundation:
So I have your permission then ? Of course I will keep proper attribution.
>
>
- an extension to NSCoding for named parameters is added
>
- a category implements this for the built-in NSCoders by ignoring the
>
names
>
- all new code should use the named coding extensions
>
- convenience Macros are provided
>
>
encodeVar( coder, variableName )
>
>
- as a last resort a hack is provided to get or make up names for
>
existing classes that don't provide a name
>
>
> I noticed that you have NSObject additions for getting the name of an
>
> instance variable at an offset. Can I use that code for contribution
>
> to the
>
> MiscKit ?
>
>
Sure, but please give credit.
>
Great!