• 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
NSMutableDictionary <-- setter method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMutableDictionary <-- setter method


  • Subject: NSMutableDictionary <-- setter method
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Wed, 28 Apr 2004 10:53:45 -0700

Greetings:
I'm trying to write a setter method for a NSMutableDictionary
instance variable. I understand that I can't merely do an equality
assignment such as:


- (void) setCities: (NSMutableDictionary *) theCities {
Cities = theCities; // Wrong.
}

However, I don't see a 'copy' method available to this class; didn't
work.

So I discovered this:

- (void) setCities: (NSMutableDictionary *) theCities {
[Cities setDictionary:theCities];
[theCities release]; ----- ?
}


Is this the correct approach? Should I release 'theCities'?

[theCities release]; ?


Thanks in advance.

Ric.
_______________________________________________
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 <-- setter method
      • From: "Jonathan E. Jackel" <email@hidden>
    • Re: NSMutableDictionary <-- setter method
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Cocoa Bindings, NSMatrix, setting programmatically
  • Next by Date: Re: Releasing a sub-view
  • Previous by thread: Porting to Linux and Windows
  • Next by thread: Re: NSMutableDictionary <-- setter method
  • Index(es):
    • Date
    • Thread