Skip navigation.
 
mlRe: how do I put an object in a dictionary, change the object but leave the dict untouched?
FROM : Cameron Hayne
DATE : Sat Jun 24 22:12:12 2006

On 24-Jun-06, at 3:20 PM, Alan Smith wrote:

> Each entry of dict1 has a dict2 in it.
> [...]
> [dict2 setObject: @"some object" forKey: @"object"];
> [dict1 setObject: dict2 forKey: @"firstEntry"];
>
> [dict2 setObject: @"another object" forKey: @"object"];
> [dict1 setObject: dict2 forKey: @"secondEntry"];


As Ashley Clark has already pointed out, according to your code,
there is only one dict2 object and it is referred to in all dict1 
entries.
So instead of "Each entry of dict1 has a dict2 in it", the situation 
is really "Each entry of dict1 has the dict2 in it."

--
Cameron Hayne
<email_removed>

Related mailsAuthorDate
mlhow do I put an object in a dictionary, change the object but leave the dict untouched? Alan Smith Jun 24, 21:20
mlRe: how do I put an object in a dictionary, change the object but leave the dict untouched? Ashley Clark Jun 24, 21:34
mlRe: how do I put an object in a dictionary, change the object but leave the dict untouched? Cameron Hayne Jun 24, 22:12
ml[SOLVED] how do I put an object in a dictionary, change the object but leave the dict untouched? Alan Smith Jun 25, 00:46