• 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: Toll-free bridge type at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toll-free bridge type at runtime


  • Subject: Re: Toll-free bridge type at runtime
  • From: Marcel Weiher <email@hidden>
  • Date: Thu, 2 Apr 2009 12:20:00 -0700


On Apr 1, 2009, at 21:44 , Michael Ash wrote:

On Thu, Apr 2, 2009 at 12:33 AM, Ryan Joseph
[distinguishing between NSArray and CFArray]
The test cannot be performed, because the question does not make any sense.

While this answer is mostly true for what the original poster is trying to accomplish (as far as I can tell), it is actually not true.


An NSCFArray and a CFArray are indistinguishable as described, and if you as for an NSArray, you will typically get an NSCFArray.

However, an actual NSArray that is not an NSCFArray will be different and distinguishable. This distinction is also not just academic, but quite important because it is used by CoreFoundation to know wether to call its own functions or send a message to the object in question, allowing custom NSArray subclasses to be used in CFArray calls.

An NSArray is a CFArray. A CFArray is an NSArray. You can't take one
of them and ask which one it is any more than you can ask your friend
whether he's Bob or Bill. They're just two names for the same thing.

s/NSArray/NSCFArray/g

Cheers,

Marcel

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Toll-free bridge type at runtime
      • From: Michael Ash <email@hidden>
References: 
 >Toll-free bridge type at runtime (From: Ryan Joseph <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: disable row highlighting NSTableView
  • Next by Date: Re: [Q] doubleAction on a NSTableView misbehaving?
  • Previous by thread: Re: Toll-free bridge type at runtime
  • Next by thread: Re: Toll-free bridge type at runtime
  • Index(es):
    • Date
    • Thread