Re: NSCFDictionary custom callbacks (Or: I Was Wrong)
Re: NSCFDictionary custom callbacks (Or: I Was Wrong)
- Subject: Re: NSCFDictionary custom callbacks (Or: I Was Wrong)
- From: "Michael Ash" <email@hidden>
- Date: Thu, 8 Jun 2006 23:51:26 -0400
And wouldn't you know it, I have a correction to the correction. Two
people have contacted me off-list about the problem and one of them,
Adam Maxwell, pointed me toward the true bug. It turns out that
NSDictionary does indeed respect CFDictionary callbacks, but it also
does its own thing. The end result is that setting a key using Cocoa
will always copy the key and then invoke your custom key retain
callback afterwards. It seems that it's safe to rely on your custom
callbacks as long as you're not trying to avoid key copying, but in
that one case it still fails.
My initial broken test case, aside from having a bug which prevented
it from working right at all, only tested to see if the callbacks were
invoked, but didn't test to see if the default behavior was not
invoked.
In case anyone is really interested and wants to see the new test
case, I've posted it here:
http://www.mikeash.com/tmp/dictionary_callbacks.m
And this will hopefully be the last word from me until another six
months passes and Apple responds to my updated bug report.
Mike
_______________________________________________
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