mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
a20550f7af
commit
4ee3178adf
2 changed files with 23 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue