[Biococoa-dev] mass calculator bug

Koen van der Drift kvddrift at earthlink.net
Sat Aug 28 08:50:24 EDT 2004


On Aug 28, 2004, at 6:24 AM, Alexander Griekspoor wrote:

>     [copy setSequence: [self sequence]];
>



John,  you implemented this method setSequence as follows:

- (void)setSequence:(NSMutableArray *)anArray
{
     [sequenceArray release];

     sequenceArray = [[NSMutableArray alloc] init];

     NSEnumerator *theEnumerator = [sequenceArray objectEnumerator];
     id aSymbol;
     while ( aSymbol = [theEnumerator nextObject] ) {
         if ( [aSymbol isKindOfClass: [BCSymbol class]] )
             [sequenceArray addObject: aSymbol];
     }
}


I am now implementing all the accessors, and was wondering why you 
don't use this:

- (void) setSequence: (NSMutableArray *) anArray
{
	[anArray retain];
	[sequence release];
	sequence = anArray;
}


I think now the copyWithZone is available and we mark this @private, 
the latter should be enough.

Also, I suggest we use 'sequenceArray' instead of 'sequence'. Any 
objections anyone?


cheers,

- Koen.




More information about the Biococoa-dev mailing list