FROM : Ondra Cada
DATE : Wed Nov 20 05:19:56 2002
On Tuesday, Nov 19, 2002, at 16:13 Europe/Prague, Starman wrote:
> I think it could be something optimized, since you gain memory space
> and computing time, but can we say that NSString conforms to NSCopying
> Protocol ? It has not the behaviour a developer will expect....
>
> Am I correct ?
No, you are not. The proper way a developer expects of any *immutable*
object is to have its -copy implemented as a plain "return [self
retain]". The advantages are obvious, there are no disadvantages.
---
Ondra Cada
OCSoftware: <email_removed> http://www.ocs.cz
private <email_removed> http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Wed Nov 20 05:19:56 2002
On Tuesday, Nov 19, 2002, at 16:13 Europe/Prague, Starman wrote:
> I think it could be something optimized, since you gain memory space
> and computing time, but can we say that NSString conforms to NSCopying
> Protocol ? It has not the behaviour a developer will expect....
>
> Am I correct ?
No, you are not. The proper way a developer expects of any *immutable*
object is to have its -copy implemented as a plain "return [self
retain]". The advantages are obvious, there are no disadvantages.
---
Ondra Cada
OCSoftware: <email_removed> http://www.ocs.cz
private <email_removed> http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Starman | Nov 19, 16:13 | |
| Ondra Cada | Nov 20, 05:19 | |
| Sherm Pendley | Nov 20, 05:49 | |
| Glenn Howes | Nov 20, 07:28 | |
| Jonathan E. Jackel | Nov 20, 23:28 | |
| Finlay Dobbie | Nov 23, 23:43 |






Cocoa mail archive

