FROM : Starman
DATE : Tue Nov 19 16:13:53 2002
Hi everyone !
I just saw that NSString doesn't conform to NSCopying Protocol.
Theorically, the documentation of the protocol says : "The exact
meaning of \"copy\" can vary from class to class, but a copy must be a
functionally independent object with values identical to the original
at the time the copy was made."
So, I understand that a copy of a NSString gives me a new instance of
the object. But in fact, I get the same object (same memory address),
with retainCount incremented by one.
you can find a small tool to check what I say at the following url :
http://ixqdev.online.fr/BetaPBX/testString.tgz
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 ?
Starman
_______________________________________________
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 : Tue Nov 19 16:13:53 2002
Hi everyone !
I just saw that NSString doesn't conform to NSCopying Protocol.
Theorically, the documentation of the protocol says : "The exact
meaning of \"copy\" can vary from class to class, but a copy must be a
functionally independent object with values identical to the original
at the time the copy was made."
So, I understand that a copy of a NSString gives me a new instance of
the object. But in fact, I get the same object (same memory address),
with retainCount incremented by one.
you can find a small tool to check what I say at the following url :
http://ixqdev.online.fr/BetaPBX/testString.tgz
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 ?
Starman
_______________________________________________
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

