Source/Piece.m
changeset 6 af9b2b929b03
parent 0 e9f7ba4718e1
child 9 a59acc683080
     1.1 --- a/Source/Piece.m	Fri Mar 07 11:43:02 2008 -0800
     1.2 +++ b/Source/Piece.m	Wed Mar 12 15:51:32 2008 -0700
     1.3 @@ -40,20 +40,11 @@
     1.4  }
     1.5  
     1.6  
     1.7 -- (id) initWithCoder: (NSCoder*)decoder
     1.8 +- (id) copyWithZone: (NSZone*)zone
     1.9  {
    1.10 -    self = [super initWithCoder: decoder];
    1.11 -    if( self ) {
    1.12 -        self.imageName = [decoder decodeObjectForKey: @"imageName"];
    1.13 -        // (actual image (self.contents) was already restord by superclass)
    1.14 -    }
    1.15 -    return self;
    1.16 -}
    1.17 -
    1.18 -- (void) encodeWithCoder: (NSCoder*)coder
    1.19 -{
    1.20 -    [super encodeWithCoder: coder];
    1.21 -    [coder encodeObject: _imageName forKey: @"imageName"];
    1.22 +    Piece *clone = [super copyWithZone: zone];
    1.23 +    clone.imageName = self.imageName;
    1.24 +    return clone;
    1.25  }
    1.26  
    1.27