[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #21133] NSKeyedArchiver doesn't encode NSData correctly
From: |
Pauli Ojala |
Subject: |
[bug #21133] NSKeyedArchiver doesn't encode NSData correctly |
Date: |
Fri, 21 Sep 2007 21:01:53 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7 |
URL:
<http://savannah.gnu.org/bugs/?21133>
Summary: NSKeyedArchiver doesn't encode NSData correctly
Project: GNUstep
Submitted by: pojala
Submitted on: Friday 21/09/07 at 21:01
Category: Base/Foundation
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
NSKeyedArchiver doesn't properly encode an NSData object's contents as a data
block. The reason for this appears to be that NSData is a class cluster but
NSKeyedArchiver fails to check for NSData's concrete subclasses (e.g.
NSDataMalloc) when encoding.
On line 248 in NSKeyedArchiver.m, the following check is performed to
determine if an object is stored directly:
if (c == [NSString class]
|| c == [NSNumber class]
|| c == [NSDate class]
|| c == [NSData class]
)
Adding the following additional conditions resolved the problem for me:
|| [c isSubclassOfClass:[NSString class]]
|| [c isSubclassOfClass:[NSNumber class]]
|| [c isSubclassOfClass:[NSDate class]]
|| [c isSubclassOfClass:[NSData class]]
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?21133>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #21133] NSKeyedArchiver doesn't encode NSData correctly,
Pauli Ojala <=