mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +00:00
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:
parent
febfce5a16
commit
cddc14d2b4
6 changed files with 95 additions and 42 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue