FROM : Mike McCune
DATE : Thu Jan 02 23:12:28 2003
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_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Thu Jan 02 23:12:28 2003
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_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Mike McCune | Jan 2, 23:12 | |
| Dietrich Epp | Jan 3, 01:05 | |
| Jonathan E. Jackel | Jan 3, 01:57 | |
| Dietrich Epp | Jan 3, 23:56 | |
| Mel Walker | Jan 4, 03:22 | |
| Mike McCune | Jan 7, 06:07 | |
| Andrew Thompson | Jan 7, 06:57 |






Cocoa mail archive

