• 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: NEWBIE: NSArray toll-free-bridged with CFArray?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NEWBIE: NSArray toll-free-bridged with CFArray?


  • Subject: Re: NEWBIE: NSArray toll-free-bridged with CFArray?
  • From: Mike Shields <email@hidden>
  • Date: Sat, 7 Sep 2002 22:01:54 -0600

On Saturday, September 7, 2002, at 06:25 PM, ber wrote:

Thanks Andreas,

I'm assuming at this point even if things are 'toll-free-bridged' one can expect
the compiler to still complain.

brian

Yes, NSArray and CFArray are toll-free bridged, but that's an implementation detail. There's no method for the _compiler_ to determine that a CFArray == an NSArray, so you have to typecast. Here's an example to illustrate what I mean.

typedef struct _Foo
{
char a;
char b;
char c;
char d;
} Foo;

typedef struct _Bar
{
char a;
char b;
char c;
char d;
} Bar;

These two structs are identical and in my little fantasy world they contain the same information and mean the same things semantically. But from the compiler's point of view, they have no relation to each other so if I wanted to do this:

Foo* aFooPtr;
Bar aBar;

aFooPtr = &aBar;

The compiler would complain since I'm trying to assign a pointer of one type to a pointer of another type. This is the same thing that's going on with NSArray and CFArray.

Hope this clears every thing up for you.

Mike
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NEWBIE: NSArray toll-free-bridged with CFArray?
      • From: ber <email@hidden>
    • Re: NEWBIE: NSArray toll-free-bridged with CFArray?
      • From: Andrew Pinski <email@hidden>
References: 
 >Re: NEWBIE: NSArray toll-free-bridged with CFArray? (From: ber <email@hidden>)

  • Prev by Date: Re: OT: fun with phonics...
  • Next by Date: Re: [Newbie] Good NSDictionary example?
  • Previous by thread: Re: NEWBIE: NSArray toll-free-bridged with CFArray?
  • Next by thread: Re: NEWBIE: NSArray toll-free-bridged with CFArray?
  • Index(es):
    • Date
    • Thread