Re: Help with encodeObject: forKey:
Re: Help with encodeObject: forKey:
- Subject: Re: Help with encodeObject: forKey:
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 03 Dec 2002 04:16:31 -0500
on 02-12-02 8:28 PM, Ian Gillespie at email@hidden wrote:
>
Whenever I save, the first line of code in this method gives the
>
following error:
>
>
Exception raised during posting of notification. Ignored. exception:
>
*** -encodeObject:forKey: only defined for abstract class. Define
>
-[NSArchiver encodeObject:forKey:]!
Read up on NSArchiver, NSCoder, and archiving in general in the Cocoa
developer documentation. Also read the very long passage on keyed archiving
in the Jaguar Foundation release notes. Also, you'll find a "how-to" article
on keyed archiving at stepwise.com -- look in the Articles index for Recipe
12 of the Vermont Recipes tutorial (or buy my book).
Basically, as your error message says, NSCoder is an abstract class whose
methods are intended to be overridden by concrete subclasses for actual use.
The primary example of a concrete subclass is NSArchiver (or NSKeyedArchiver
for Jaguar and newer), which is what you should be using. You could write
your own concrete subclass, but there isn't much point because the existing
archiving classes cover the basics and then some.
This is a complex subject. And, since keyed archiving is new in Jaguar, it
introduces serious backward compatibility issues of its own -- which are
discussed at length, with suggested strategies, in the release notes (and I
believe recently in the updated developer documentation).
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
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.