• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSString and NSCopying Protocol
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString and NSCopying Protocol


  • Subject: NSString and NSCopying Protocol
  • From: Starman <email@hidden>
  • Date: Tue, 19 Nov 2002 16:13:53 +0100

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@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.

  • Follow-Ups:
    • Re: NSString and NSCopying Protocol
      • From: Finlay Dobbie <email@hidden>
    • RE: NSString and NSCopying Protocol
      • From: "Jonathan E. Jackel" <email@hidden>
    • Re: NSString and NSCopying Protocol
      • From: Glenn Howes <email@hidden>
    • Re: NSString and NSCopying Protocol
      • From: Sherm Pendley <email@hidden>
    • Re: NSString and NSCopying Protocol
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: NSFormatter what table am I in ??
  • Next by Date: No launchable executable present?
  • Previous by thread: Animated GIF with transparency?
  • Next by thread: Re: NSString and NSCopying Protocol
  • Index(es):
    • Date
    • Thread