[BioCocoa-dev] Peptides...

Koen van der Drift kvddrift at earthlink.net
Mon Mar 28 06:38:51 EST 2005


On Mar 28, 2005, at 2:53 AM, Charles PARNOT wrote:

> At 8:01 AM -0500 3/26/05, Koen van der Drift wrote:
> On Mar 26, 2005, at 3:11 AM, Charles PARNOT wrote:
>
> Another option is to have a 'mutableSymbolArray' and 'symbolArray' 
> methods.
>
>
>  I like the mutableSymbolArray (or maybe mutableSymbolArrayCopy) 
> method. That should indeed return a new instance with which the the 
> user can do what she want. The symbolArray should just return a 
> pointer as it is right now (I already changed that in CVS).
>
>
>  - Koen.
>
> I did not see the change (did you commit?) so I made it while I was 
> working on the final integration of sequence classes with symbol sets. 
> I was not sure where to change the call to symbolArray into 
> mutableSymbolArray, so that 'Peptides' runs fast?
>
> charles
>
> NB: here are the methods
>
> - (NSMutableArray *)mutableSymbolArray
>  {
>  return symbolArray;
>  }
>
>  - (NSArray *)symbolArray
>  {
>    return [[symbolArray copy] autorelease];
>  }
>

I think you switched them around. IMO it should be as follows:

- (NSMutableArray *)mutableSymbolArray
  {
   return [[symbolArray mutableCopy] autorelease];		// do we need an 
autorelease here?
  }

  - (NSArray *)symbolArray
  {
   return symbolArray;
  }



- Koen.




More information about the Biococoa-dev mailing list