Re: Bug when encoding subclasses of NSData?
Re: Bug when encoding subclasses of NSData?
- Subject: Re: Bug when encoding subclasses of NSData?
- From: Jonathan Wight <email@hidden>
- Date: Tue, 16 Dec 2003 16:34:16 -0600
On Dec 16, 2003, at 16:30, Shawn Erickson wrote:
>
On Dec 16, 2003, at 1:05 PM, Jonathan Wight wrote:
>
>
> I have a subclass of NSData that I am providing my own NSCoding
>
> methods
>
> for. When an object of this class is archived I want to archive extra
>
> information alongside the bytes of the object.
>
>
>
> Unfortunately when I try to archive my object only the bytes are
>
> archived and none of my extra information is getting archived. It
>
> turns
>
> out that my subclass's -encodeWithCoder method isn't getting called at
>
> all. I can only assume that NSArchiver recognises my object as an
>
> NSData-like object and thinks it knows how to archive it without
>
> bothering to go through encodeWithCoder.
>
>
>
>
>
> Because NSData supports the NSCoder protocol I would expect the
>
> archiving to go through -encodeWithCoder, but as I've found out it
>
> doesn't seem to. This seems like a definite bug to me... Is this a
>
> known bug and are there any work arounds?
>
>
You implemented -encodeWithCoder:(NSCoder*) encoder, correct?
>
>
You are talking about -encodeWithCoder in the above which is different
>
then -encodeWithCoder:. Not sure if you are just using short hand
>
but...
>
>
-Shawn
Yeah - I was referring to "-encodeWithCoder:" (damn sneaky colons).
Jon.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.