mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +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
|
@ -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…
Add table
Add a link
Reference in a new issue