• 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 bridged" types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Toll free bridged" types


  • Subject: Re: "Toll free bridged" types
  • From: Bill Cheeseman <email@hidden>
  • Date: Thu, 09 Jan 2003 04:56:16 -0500

on 03-01-08 9:25 PM, ryan at email@hidden wrote:

> I'm investigating the "toll free bridged" types in CoreFoundation/Cocoa.
> According to the documentation, certain types such as CFStringRef can be
> casted to NSString * without any problem.

Yes. And the documentation is far from complete. For example, lots of
relatively simple types like NSNumber are toll-free bridged to their Core
Foundation counterparts.

> The question is how far does this compatibility extend? From the
> documentation I can surmise that the reference counting fields are the same
> in NSObject and CFTypes. But how far does that compatibility extend? Is
> the type systems similar?

All the way. In my experience, they are literally identical.

> IE: If I do:
>
> CFStringRef stringRef = CFStringCreate( ... ) ;
> Id kindaString = (id) stringRef ;
>
> Does 'kindaString' act like a NSString?

Yes. It even becomes autorelease-able, despite the fact that autorelease
isn't available outside Cocoa.


--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont - http://members.valley.net/croquetvermont
_______________________________________________
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:
    • NSStatusItem and shadowed font
      • From: "Raymund Beyer" <email@hidden>
References: 
 >"Toll free bridged" types (From: ryan <email@hidden>)

  • Prev by Date: Getting notified when the contents of the pasteboard changes (again)
  • Next by Date: Re: Forcing NSUserDefaults being written to disk?
  • Previous by thread: Re: "Toll free bridged" types
  • Next by thread: NSStatusItem and shadowed font
  • Index(es):
    • Date
    • Thread