[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Keyed archiving and class clusters
From: |
David Chisnall |
Subject: |
Re: Keyed archiving and class clusters |
Date: |
Mon, 28 Jun 2010 15:19:04 +0100 |
On 28 Jun 2010, at 15:15, Thomas Davie wrote:
> Hi all,
>
> From what I understand, GNUstep's keyed archive format is meant to be
> compatible with Apple's.
I don't think this is the case, but it's possible.
> However, I'm hitting an issue and I'm not certain if it's the fault of the
> archiver, or class clusters.
>
> Basically, when an NSMutableSet gets encoded, what really gets encoded is
> it's concrete subclass, GSMutableSet... When I try to decode this in some
> code using apple's implementation, it chokes, not having a GSMutableSet class
> to attempt to init.
This is expected behaviour. Archiving is low-level functionality. You are not
expected to be able to serialize objects using one Foundation implementation
and restore them with another, because they contain things like serialized
ivars.
> Is there any sane way round this, or should I get on with writing my own
> serialisation methods if I want to send objects back and forth between
> apple/GNUstep implementations?
You can use NSPropertyListSerialization if you want a format that is
implementation-agnostic.
David