• 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: Chris Suter <email@hidden>
  • Date: Fri, 3 Apr 2009 11:54:01 +1100

Hi Marcel,

On Fri, Apr 3, 2009 at 11:06 AM, Marcel Weiher <email@hidden> wrote:

> As I explained,

Did you?

> it is trivially possible, because the only Objective-C class
> that is the same as its underlying CFType is NSCFArray.  So a simple test
> would be  [object class] == [NSCFArray class].

Right. So something like this then:

#import <Foundation/Foundation.h>

@class NSCFArray;

void logIfCFArray (id p)
{
  if ([p class] == [NSCFArray class])
    NSLog (@"Object is NSCFArray\n");
}

int main (int argc, char *argv[])
{
  NSArray *a = [[NSArray alloc] init];
  CFArrayRef b = CFArrayCreate (NULL, NULL, 0, &kCFTypeArrayCallBacks);

  logIfCFArray ((id)a);
  logIfCFArray ((id)b);

  return 0;
}

But that doesn't seem to work. It produces:

2009-04-03 11:49:52.032 test[84218:10b] Object is NSCFArray
2009-04-03 11:49:52.034 test[84218:10b] Object is NSCFArray

So, I'm still confused.

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

  • Follow-Ups:
    • Re: Toll-free bridge type at runtime
      • From: Marcel Weiher <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>)
 >Re: Toll-free bridge type at runtime (From: Marcel Weiher <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Michael Ash <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Marcel Weiher <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Michael Ash <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Marcel Weiher <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Chris Suter <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Marcel Weiher <email@hidden>)

  • Prev by Date: Re: Seeking advice on best practice for managing visibility of many subviews
  • Next by Date: Re: Toll-free bridge type at runtime
  • Previous by thread: Re: Toll-free bridge type at runtime
  • Next by thread: Re: Toll-free bridge type at runtime
  • Index(es):
    • Date
    • Thread