Re: substring return a new string?
Re: substring return a new string?
- Subject: Re: substring return a new string?
- From: Ondra Cada <email@hidden>
- Date: Thu, 18 Mar 2004 18:12:23 +0100
Marco,
On Thursday, Mar 18, 2004, at 17:32 Europe/Prague, Marco Scheurer wrote:
so far as I can say the only remaining possibility is to *declare*
the method returning mutable data, and *document* the fact it is
always freshly-created: let then the client decide what to do with >> it:
@interface ...
...
-(NSMutableArray*)someArray; // created each time the message is
sent, not stored then
...
// implementation exactly as you suggested.
Certainly not! Declaring the method as returning NSMutableArray
documents the fact that the user can modify the returned array. This
is most likely not what you want.
Why not, in this case? Nobody can ever share the array with the user
(who may change it), unless the user (who may change it) allows it
himself, so I would say all right. Am I overlooking something important?
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.