Re: Toll-free bridge type at runtime
Re: Toll-free bridge type at runtime
- Subject: Re: Toll-free bridge type at runtime
- From: Chris Suter <email@hidden>
- Date: Fri, 3 Apr 2009 10:43:52 +1100
Hi Marcel,
On Fri, Apr 3, 2009 at 10:37 AM, Marcel Weiher <email@hidden> wrote:
> So the compiler also disagrees with you that these are the same type. You
> can *cast* them to be compatible, but they are not the same type.
Right, but the original question was about figuring out what they are
at runtime which I don't believe is possible and it's not clear to me
whether you think it is possible. You seem to be suggesting it might
be. Perhaps you could complete this but of test code:
#import <Foundation/Foundation.h>
void logIfCFArray (const void *p)
{
if (/* some test here */)
NSLog (@"Object is CFArray\n");
}
int main (int argc, char *argv[])
{
NSArray *a = [[NSArray alloc] init];
CFArrayRef b = CFArrayCreate (NULL, NULL, 0, &kCFTypeArrayCallBacks);
logIfCFArray (a);
logIfCFArray (b);
return 0;
}
Regards,
Chris
_______________________________________________
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