• 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
RE: NSMutableDictionary Q's
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: NSMutableDictionary Q's


  • Subject: RE: NSMutableDictionary Q's
  • From: "Jonathan E. Jackel" <email@hidden>
  • Date: Thu, 2 Jan 2003 19:57:11 -0500

> In addition, you probably shouldn't be retaining the NSStrings passed to
> the set... methods. You should be copying them, or at least in the case
> of setName.

Huh?

Accessors in the code I have seen (and written) retain strings in setters
without any problem at all.

I'm going out on a wee bit of a limb because I haven't seen the source code
for NSString, but . . . the NSCopying protocol (to which NSString conforms)
strongly implies that a nonmutable string that is sent a "copy" message is
simply retained. The object that made the copy owns the copy and has to
release the copy -- exactly as if the object had just retained the string.

There's no difference. Is there?

Jonathan
_______________________________________________
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: NSMutableDictionary Q's
      • From: Dietrich Epp <email@hidden>
References: 
 >Re: NSMutableDictionary Q's (From: Dietrich Epp <email@hidden>)

  • Prev by Date: PB compiler Choice
  • Next by Date: Re: "Suitcase" messing with fonts chosen in nib files?
  • Previous by thread: Re: NSMutableDictionary Q's
  • Next by thread: Re: NSMutableDictionary Q's
  • Index(es):
    • Date
    • Thread