TollFreeBridging

Crowd-sourced documentation and tutorials by the Cocoa developer community
Jump to: navigation, search


TollFreeBridging is what allows you to take CoreFoundation types and typecast them to Cocoa types (and vice versa).

So, if you have to call a CoreFoundation function that takes a CFString, but you have an NSString, you can just pass it your NSString with:

CFStringRef myCFString = (CFStringRef)someNSString;

And if you need to get an NSString from a CFString, you can do this:

NSString myNSString = (NSString)someCFString;

see also: HowToCreateTollFreeBridgedClass

See which classes are TollFreeBridged.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox