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

NSMutableDictionary Q's


  • Subject: NSMutableDictionary Q's
  • From: Mike McCune <email@hidden>
  • Date: Thu, 2 Jan 2003 17:12:28 -0500

hey all, I'm writing a small app in my further studies of cocoa and I'm having a problem using NSMutableDictionary. I'm curious if I can use a member of an object to be added to the dictionary as the key. here's a small example, SomeDataClass has 2 members both NSString *'s.

SomeDataClass *ptemp;
SomeDataClass temp;

[temp setName: @"foo"];
[temp setDesc: @"some object"];
[SomeMutableDictionary setObject: temp forKey: [temp name]];
ptemp = [SomeMutableDictionary objectForKey: @"foo"];

now when I do this and then try to access [ptemp desc] there's nothing there. [ptemp name] is valid, but nothing else. any ideas here? just to clear things up, in SomeDataClass the "set" methods retain the new NSString passed to them.

Sincerely,

Mike McCune
OPB Studios
email@hidden
_______________________________________________
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>
  • Prev by Date: Re: Equivalent to "ps aux" in Cocoa?
  • Next by Date: Re: straight-C DNS lookup with timeout?
  • Previous by thread: [Semi-OT] dmg and iApps
  • Next by thread: Re: NSMutableDictionary Q's
  • Index(es):
    • Date
    • Thread