Re: Weird behavior in NSMutableDictionary
Re: Weird behavior in NSMutableDictionary
- Subject: Re: Weird behavior in NSMutableDictionary
- From: Harilaos Skiadas <email@hidden>
- Date: Sat, 18 Dec 2004 02:33:29 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
--- Steven Kramer <email@hidden> wrote:
>
> Op 18-dec-04 om 5:10 heeft Harilaos Skiadas het
> volgende geschreven:
>
> > 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 probably overreleasing 'aKey' from 'anItem'
> somewhere. Try
Weird. I just used the original form again, no retain
or copies, and it works just fine now. I must have
been blind (or extremely tired, or probably both), or
maybe XCode playing tricks on me.
> [[anItem valueForKey: @"aKey"] retain] to see if
> this also fixes the
> problem. Then you know you have a retain bug
> somewhere. Also search for
> zombie debugging with Cocoa. BTW You should of
> course (auto)release the
> copy you made after valueForKey!
Yeah, I realized that right after sending the email
out.
> Regards,
>
> Steven Kramer
Thanks for the help,
Haris
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
_______________________________________________
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