Re: Toll-free bridge type at runtime
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