diff --git a/ChangeLog b/ChangeLog index 1353a29b4..47797c4c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-01-11 Quentin Mathe + + * Source/NSFormatter.m (-copyWithZone:, -initWithCoder:, + -encodeWithCoder:): Removed the subclass responsability, in order to + have subclasses automatically coding and copying compliant as Cocoa does. + You can also now safely call [super copyWithZone:/initWithCoder:] in a + subclass. + 2010-01-11 Richard Frith-Macdonald * Source/NSMapTable.m: diff --git a/Source/NSFormatter.m b/Source/NSFormatter.m index 2e2b5040e..7a95e46d7 100644 --- a/Source/NSFormatter.m +++ b/Source/NSFormatter.m @@ -38,8 +38,7 @@ - (id) copyWithZone: (NSZone*)zone { - [self subclassResponsibility: _cmd]; - return nil; + return [[self class] allocWithZone: zone]; } - (NSString*) editingStringForObjectValue: (id)anObject @@ -49,7 +48,7 @@ - (void) encodeWithCoder: (NSCoder*)aCoder { - [self subclassResponsibility: _cmd]; + } - (BOOL) getObjectValue: (id*)anObject @@ -62,8 +61,7 @@ - (id) initWithCoder: (NSCoder*)aCoder { - [self subclassResponsibility: _cmd]; - return nil; + return [super init]; } - (BOOL) isPartialStringValid: (NSString*)partialString