• 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: Loading a Dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading a Dictionary


  • Subject: Re: Loading a Dictionary
  • From: Kevin Ballard <email@hidden>
  • Date: Thu, 3 Feb 2005 21:14:34 -0500

NSDictionary copies keys and retains values. So you can discard any reference to anything you put in the dictionary - the key is copied, so is truly owned by the dictionary. The value is retained, so as long as your retain/releases are balanced, the dictionary will continue to hold on to it after you let it go.

On Feb 3, 2005, at 8:47 PM, Richard Patterson wrote:

Is there sample code somewhere for how to load entries into an NSMutableDictionary? My initial effort seems to have created something crash inducing. I think my mistake is that I assumed the objects were being copied when they were put into the dictionary.

Does a dictionary only contain a references to an objects that must be globaly available along with the dictionary?

Should I create an array of objects and then use that to load the dictionary?

-- Kevin Ballard email@hidden http://www.tildesoft.com http://kevin.sb.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Loading a Dictionary (From: Richard Patterson <email@hidden>)

  • Prev by Date: Re: Loading a Dictionary
  • Next by Date: Re: Method not seeing array as array
  • Previous by thread: Re: Loading a Dictionary
  • Next by thread: HFS+ File Question
  • Index(es):
    • Date
    • Thread