NSMutableDictionary Q's
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.