mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +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
b3ce89a609
commit
24251c6439
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>
|
2006-08-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSPredicate.m: Reorganize initialisation of scanner to avoid
|
* Source/NSPredicate.m: Reorganize initialisation of scanner to avoid
|
||||||
|
|
|
@ -1511,12 +1511,28 @@ failure:
|
||||||
|
|
||||||
- (void) encodeWithCoder: (NSCoder*)coder
|
- (void) encodeWithCoder: (NSCoder*)coder
|
||||||
{
|
{
|
||||||
[coder encodeDataObject: self];
|
if([coder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
[coder encodeObject: self];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[coder encodeDataObject: self];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)coder
|
- (id) initWithCoder: (NSCoder*)coder
|
||||||
{
|
{
|
||||||
id obj = [coder decodeDataObject];
|
id obj = nil;
|
||||||
|
|
||||||
|
if([coder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
obj = [coder decodeObject];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj = [coder decodeDataObject];
|
||||||
|
}
|
||||||
|
|
||||||
if (obj != self)
|
if (obj != self)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue