Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

2. Objective-C Boot Camp > Using ARC with Core Foundation and Toll Free Bridgin...

Using ARC with Core Foundation and Toll Free Bridging

Core Foundation objects are a reality for anyone who develops iOS applications outside of the most limited UIKit situations. These classes use C-based APIs rather than Objective-C. Core Foundation can be used directly, using CF-style classes such as CFStringRef, or by using any iOS frameworks that adhere to Core Foundation conventions, such as Core Graphics, Core Text, and Address Book, among others.

ARC does not integrate into Core Foundation object management. That leaves the memory management in your hands, as old-style Objective-C did. If you allocate, you must release. CFRetain() and CFRelease() continue with the same roles they held prior to ARC’s debut.

Toll Free Bridging allows you to work with Core Foundation objects in an Objective-C context, and vice versa. To cast an object from one to the other and back, use the qualifiers and function demonstrated in this section.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial