Patched from mail.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@597 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1995-08-30 21:49:35 +00:00
parent febfce5a16
commit cddc14d2b4
6 changed files with 95 additions and 42 deletions

View file

@ -141,18 +141,19 @@
// NSCoding
- (void)encodeWithCoder:(NSCoder *)coder
{
const char *type;
[super encodeWithCoder:coder];
// FIXME: Do we need to check for encoding void, void * or will
// NSCoder do this for us?
[coder encodeObject:objctype];
[coder encodeValueOfObjCType:[objctype cString] at:&data];
type = [objctype cString];
[coder encodeValueOfObjCType:@encode(char *) at:&type];
[coder encodeValueOfObjCType:type at:&data];
}
- (id)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
objctype = [[coder decodeObject] retain];
[coder decodeValueOfObjCType:[objctype cString] at:&data];
[NSException raise:NSInconsistentArchiveException
format:@"Cannot unarchive class - Need NSValueDecoder."];
return self;
}