git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15654 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-01-20 17:18:06 +00:00
parent 2aafe79eee
commit 4bd6038dd5
8 changed files with 138 additions and 47 deletions

View file

@ -141,15 +141,31 @@ static SEL appSel;
return nil;
}
/**
* Returns a new copy of the receiver.<br />
* The default abstract implementation of a copy is to use the
* -initWithDictionary:copyItems: method with the flag set to YES.<br />
* Immutable subclasses generally simply retain and return the receiver.
*/
- (id) copyWithZone: (NSZone*)z
{
return RETAIN(self);
NSDictionary *copy = [NSDictionaryClass allocWithZone: z];
return [copy initWithDictionary: self copyItems: NO];
}
/**
* Returns a new instance containing the same objects as
* the receiver.<br />
* The default implementation does this by calling the
* -initWithDictionary:copyItems: method on a newly created object,
* and passing it NO to tell it just to retain the items.
*/
- (id) mutableCopyWithZone: (NSZone*)z
{
return [[GSMutableDictionaryClass allocWithZone: z]
initWithDictionary: self];
NSMutableDictionary *copy = [NSMutableDictionaryClass allocWithZone: z];
return [copy initWithDictionary: self copyItems: NO];
}
- (Class) classForCoder