Re: how do I put an object in a dictionary, change the object but leave the dict untouched?
Re: how do I put an object in a dictionary, change the object but leave the dict untouched?
- Subject: Re: how do I put an object in a dictionary, change the object but leave the dict untouched?
- From: Cameron Hayne <email@hidden>
- Date: Sat, 24 Jun 2006 16:12:12 -0400
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@hidden
_______________________________________________
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