mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
* Source/NSString.m (-initWithCoder:): In keyed coding the key
"NS.bytes" may contain either an NSData or an NSString object. Not sure about the encoding, I am using UTF8. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34010 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a6a481bead
commit
e6a75007c0
2 changed files with 31 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
|||
2011-10-17 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSString.m (-initWithCoder:): In keyed coding the key
|
||||
"NS.bytes" may contain either an NSData or an NSString object. Not
|
||||
sure about the encoding, I am using UTF8.
|
||||
|
||||
2011-10-17 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* standalone.conf: First draft at a layout for standalone system
|
||||
|
|
|
@ -5036,20 +5036,34 @@ static NSFileManager *fm = nil;
|
|||
{
|
||||
if ([aCoder allowsKeyedCoding])
|
||||
{
|
||||
NSString *string = nil;
|
||||
|
||||
if ([aCoder containsValueForKey: @"NS.string"])
|
||||
{
|
||||
NSString *string = nil;
|
||||
|
||||
string = (NSString*)[(NSKeyedUnarchiver*)aCoder
|
||||
_decodePropertyListForKey: @"NS.string"];
|
||||
self = [self initWithString: string];
|
||||
}
|
||||
else if ([aCoder containsValueForKey: @"NS.bytes"])
|
||||
{
|
||||
string = (NSString*)[(NSKeyedUnarchiver*)aCoder
|
||||
id bytes = [(NSKeyedUnarchiver*)aCoder
|
||||
decodeObjectForKey: @"NS.bytes"];
|
||||
}
|
||||
|
||||
self = [self initWithString: string];
|
||||
if ([bytes isKindOfClass: NSStringClass])
|
||||
{
|
||||
self = [self initWithString: (NSString*)bytes];
|
||||
}
|
||||
else
|
||||
{
|
||||
self = [self initWithData: (NSData*)bytes
|
||||
encoding: NSUTF8StringEncoding];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// empty string
|
||||
self = [self initWithString: @""];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue