• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSCFDictionary custom callbacks (Or: I Was Wrong)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSCFDictionary custom callbacks (Or: I Was Wrong) (From: "Michael Ash" <email@hidden>)

  • Prev by Date: NSCFDictionary custom callbacks (Or: I Was Wrong)
  • Next by Date: Re: Changing fonts without font menu?
  • Previous by thread: NSCFDictionary custom callbacks (Or: I Was Wrong)
  • Next by thread: FrontRow remote control events
  • Index(es):
    • Date
    • Thread