Re: Weird behavior in NSMutableDictionary
Re: Weird behavior in NSMutableDictionary
- Subject: Re: Weird behavior in NSMutableDictionary
- From: Thomas Lachand-Robert <email@hidden>
- Date: Sat, 18 Dec 2004 11:36:53 +0100
Le 18 déc. 04, à 05:10, Harilaos Skiadas a écrit :
What I want to do is add anItem as an object to aDict,
with key the string that is the object corresponding
the key @"aKey" in anItem. I would have thought that
the following would work:
[aDict setValue:anItem forKey:[anItem
valueForKey:@"aKey"]];
instead, I had to use:
[aDict setValue:anItem forKey:[[anItem
valueForKey:@"aKey"] copy];
You are confusing -valueForKey with -objectForKey and -setValueForKey
with -setObjectForKey. Check again the documentation on dictionaries.
Yours,
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet à la chose. >> Molière, Tartuffe.
_______________________________________________
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