Correct issue in initWithCoder: and encodeWithCoder: in NSData which was causing problems with keyed coding.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23211 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-08-07 04:14:58 +00:00
parent a20550f7af
commit 4ee3178adf
2 changed files with 23 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2006-08-07 00:13-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSData.m: Correct issue in initWithCoder: and encodeWithCoder:
with encoding data using keyed archiver.
2006-08-06 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPredicate.m: Reorganize initialisation of scanner to avoid

View file

@ -1511,12 +1511,28 @@ failure:
- (void) encodeWithCoder: (NSCoder*)coder
{
[coder encodeDataObject: self];
if([coder allowsKeyedCoding])
{
[coder encodeObject: self];
}
else
{
[coder encodeDataObject: self];
}
}
- (id) initWithCoder: (NSCoder*)coder
{
id obj = [coder decodeDataObject];
id obj = nil;
if([coder allowsKeyedCoding])
{
obj = [coder decodeObject];
}
else
{
obj = [coder decodeDataObject];
}
if (obj != self)
{