Core Foundation

Core Foundation

Core Foundation (also called CF) is a C application programming interface (API) in Mac OS X & iOS, and is a mix of low-level routines and wrapper functions. Apple releases most of it as an open source project called CFLite that can be used to write cross-platform applications for Mac OS X, Linux, and Windows (via Cygwin)[1]; a third-party open-source implementation called OpenCFLite also exists.[2] Most Core Foundation routines follow a certain naming convention that deal with opaque objects, for example CFDictionaryRef for functions whose names begin with CFDictionary, and these objects are often reference counted (manually) through CFRetain and CFRelease. Internally, Core Foundation forms the base of the types in the Objective-C runtime as well.

The most prevalent use of Core Foundation is for passing its own primitive types for data, including raw bytes, Unicode strings, numbers, calendar dates, and UUIDs, as well as collections such as arrays, sets, and dictionaries, to numerous OS X C routines, primarily those that are GUI-related. At the operating system level Core Foundation also provides standardized application preferences management through CFPropertyList, bundle handling, run loops, interprocess communication through CFMachPort and CFNotificationCenter, and a basic graphical user interface message dialog through CFUserNotification.

Other parts of the API include utility routines and wrappers around existing APIs for ease of use. Utility routines perform such actions as file system and network I/O through CFReadStream, CFWriteStream, and CFURL and endianness translation (Byte Order Utilities). Some examples of wrapper routines include those for Core Foundation's wrapper routines for Unix sockets, the CFSocket API.

Some types in Core Foundation are "toll-free bridged", or interchangeable with a simple cast, with those of their Foundation Kit counterparts. For example, one could create a CFDictionaryRef Core Foundation type, and then later simply use a standard C cast to convert it to its Objective-C counterpart, NSDictionary *, and then use the desired Objective-C methods on that object as one normally would.

References

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Core Text — is a Core Foundation style API in Mac OS X, first introduced in Mac OS X 10.4 Tiger, made public in Mac OS X 10.5 Leopard, and introduced for the iPad with iPhone SDK 3.2. Exposing a C API, it replaces the text rendering abilities of the now… …   Wikipedia

  • Core Services — are a set of Mac OS X and iOS application programming interfaces that architecturally are underneath Carbon, Cocoa and Cocoa Touch. In addition to Core Foundation,[1] it also encompasses other APIs including Grand Central Dispatch, Blocks,… …   Wikipedia

  • Core Data — Developer(s) Apple Inc. Stable release 3.2.0 Operating syst …   Wikipedia

  • Core Audio — Developer(s) Apple Inc. Stable release 3.2.6 Operating system Mac OS X, iOS …   Wikipedia

  • Core Animation — (Графическая модель Mac OS X) Тип System Utility Разработчик Apple Inc. Операционная система Mac OS X Лицензия Проприетарн …   Википедия

  • Core OpenGL — Mac OS X graphics model Rendering QuickDraw • Core OpenGL Quartz 2D • Core Image Core Animation • Core Video ColorSync • QuickTime Compositing …   Wikipedia

  • Core Image — Mac OS X graphics model Rendering QuickDraw • Core OpenGL Quartz 2D • Core Image Core Animation • …   Wikipedia

  • Core Video — Mac OS X graphics model Rendering QuickDraw • Core OpenGL Quartz 2D • Core Image Core Animation • Core Video ColorSync …   Wikipedia

  • Core Animation — Mac OS X graphics model Rendering QuickDraw • Core OpenGL Quartz 2D • Core Image Core Animation • Core Video Color …   Wikipedia

  • Core worlds — or core planets often exist in works of science fiction, especially space operas. They are usually at the center of the galaxy or of colonized space, occasionally both. Core worlds are densely populated with long histories, advanced technology,… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”