TechnologiesFoundation, System & Concurrency

CoreFoundation

iOSmacOStvOSwatchOSvisionOS

CoreFoundation is a low-level C framework that provides the fundamental data types, collections, and operating-system abstractions on which higher-level frameworks are built. You work with reference types such as CFString and CFMutableString for text, CFArray, CFBag, CFData, and CFBitVector for storing values, and CFAttributedString for text with associated attributes, along with helper types like CFRange, CFComparisonResult, and CFAllocator that govern memory and comparison behavior. The framework also supplies system facilities including CFBundle for locating resources, CFPlugIn for loadable code, and CFCalendar, CFDate, and CFCharacterSet for working with time and text. Geometry types such as CGPoint, CGSize, CGRect, and CGAffineTransform are likewise available for representing coordinates and transformations.

Strings and Text 11

Reference types for immutable and mutable text, attributed text, and the supporting buffers and options that govern string handling.

  • Cl
    CFString
    An object that represents an immutable Unicode string.
  • Cl
    CFMutableString
    An object that represents a Unicode string whose contents you can modify.
  • Cl
    CFAttributedString
    An object that pairs an immutable string with attributes applied to ranges of its characters.
  • Cl
    CFMutableAttributedString
    An object representing attributed text whose characters and attributes you can modify.
  • Cl
    CFStringTokenizer
    An object that divides a string into tokens such as words and sentences.
  • St
    CFStringInlineBuffer
    A structure that caches a string's characters for fast sequential access.
  • St
    CFStringCompareFlags
    Options that control how strings are compared and searched.
  • En
    CFStringBuiltInEncodings
    Constants that identify the string encodings built into Core Foundation.
  • En
    CFStringEncodings
    Constants that identify additional string encodings supported by Core Foundation.
  • En
    CFStringNormalizationForm
    @typedef CFStringNormalizationForm
  • St
    CFStringTokenizerTokenType
    Token type

Collections 18

Immutable and mutable container types for storing values, along with the callback structures that customize their behavior.

  • Cl
    CFArray
    @typedef CFArrayRef
  • Cl
    CFMutableArray
    @typedef CFMutableArrayRef
  • Cl
    CFBag
    An object that stores an immutable, unordered collection of values, allowing duplicates.
  • Cl
    CFMutableBag
    An object that stores a mutable, unordered collection of values, allowing duplicates.
  • Cl
    CFDictionary
    @typedef CFDictionaryRef
  • Cl
    CFMutableDictionary
    @typedef CFMutableDictionaryRef
  • Cl
    CFSet
    @typedef CFSetRef
  • Cl
    CFMutableSet
    @typedef CFMutableSetRef
  • Cl
    CFBinaryHeap
    @typedef CFBinaryHeapRef
  • Cl
    CFTree
    @typedef CFTreeRef
  • St
    CFArrayCallBacks
    A structure of callbacks that govern how an array retains, releases, and compares its values.
  • St
    CFBagCallBacks
    A structure of callbacks that govern how a bag retains, releases, and compares its values.
  • St
    CFDictionaryKeyCallBacks
    A structure of callbacks that govern how a dictionary retains, releases, and hashes its keys.
  • St
    CFDictionaryValueCallBacks
    @typedef CFDictionaryValueCallBacks
  • St
    CFSetCallBacks
    @typedef CFSetCallBacks
  • St
    CFBinaryHeapCallBacks
    @typedef CFBinaryHeapCallBacks
  • St
    CFBinaryHeapCompareContext
    A structure that supplies context to a binary heap's comparison callback.
  • St
    CFTreeContext
    @typedef CFTreeContext

Binary Data 5

Types for raw byte buffers, bit vectors, and the search options used when scanning binary data.

  • Cl
    CFData
    An object that stores an immutable buffer of raw bytes.
  • Cl
    CFMutableData
    An object that stores a mutable buffer of raw bytes you can append to and modify.
  • Cl
    CFBitVector
    An object that stores an immutable, ordered sequence of bits.
  • Cl
    CFMutableBitVector
    An object that stores a mutable, ordered sequence of bits you can set and clear.
  • St
    CFDataSearchFlagsiOS 4.0+
    Options that control how a byte range is searched within data.

Numbers and Boxed Values 10

Object wrappers for numeric, boolean, and null values, and the constants describing their representations.

  • Cl
    CFNumber
    An object that wraps a numeric value of any C scalar type.
  • Cl
    CFBoolean
    An object that wraps a Boolean value for storage in collections.
  • Cl
    CFNull
    An object that represents a singleton null value for use in collections.
  • En
    CFNumberType
    Constants that identify the C scalar type stored in a number object.
  • Cl
    CFNumberFormatter
    An object that converts numbers to and from their localized textual representations.
  • St
    CFNumberFormatterKey
    Constants identifying the configurable properties of a number formatter.
  • En
    CFNumberFormatterStyle
    Constants that specify the predefined formatting styles for numbers.
  • En
    CFNumberFormatterRoundingMode
    Constants that specify how a number formatter rounds values.
  • En
    CFNumberFormatterPadPosition
    Constants that specify where a number formatter inserts padding characters.
  • St
    CFNumberFormatterOptionFlags
    Options that control how a number formatter parses input.

Dates, Time, and Calendars 17

Types for representing points in time, calendars, time zones, locales, and the formatters that convert dates to text.

  • Cl
    CFDate
    An object that represents a single point in time.
  • Cl
    CFCalendar
    An object that performs calendrical calculations such as date components and ranges.
  • Cl
    CFTimeZone
    An object that represents a time zone and its offset and daylight rules.
  • Cl
    CFLocale
    An object that encapsulates conventions for formatting and interpreting region-specific data.
  • Cl
    CFDateFormatter
    An object that converts dates to and from their textual representations.
  • En
    CFDateFormatterStyle
    Constants that specify the predefined formatting styles for dates and times.
  • St
    CFDateFormatterKey
    Constants identifying the configurable properties of a date formatter.
  • St
    CFISO8601DateFormatOptions
    Options that control which components an ISO 8601 date formatter emits.
  • St
    CFCalendarUnit
    Constants that identify calendrical units such as days, months, and years.
  • St
    CFCalendarIdentifier
    A type that identifies a calendar system such as Gregorian or Hebrew.
  • St
    CFGregorianDate
    A structure that represents a date and time in the Gregorian calendar.
  • St
    CFGregorianUnits
    A structure that represents an amount of time as Gregorian calendar units.
  • St
    CFGregorianUnitFlags
    Options that identify which Gregorian units a calculation should include.
  • St
    CFLocaleIdentifier
    A type that identifies a locale by a canonical locale string.
  • St
    CFLocaleKey
    Constants identifying the components of a locale's conventions.
  • En
    CFLocaleLanguageDirection
    Constants that specify the writing direction of a language.
  • En
    CFTimeZoneNameStyleiOS 2.0+
    Constants that specify the style used to present a time zone's name.

Character Sets 3

Immutable and mutable sets of Unicode characters and the predefined sets available for membership tests.

  • Cl
    CFCharacterSet
    @typedef CFCharacterSetRef
  • Cl
    CFMutableCharacterSet
    @typedef CFMutableCharacterSetRef
  • En
    CFCharacterSetPredefinedSet
    @typedef CFCharacterSetPredefinedSet

Run Loop and Event Sources 11

The run loop and its input sources, observers, and timers that drive event processing on a thread.

  • Cl
    CFRunLoop
    An object that processes input sources and timers dispatched to a thread.
  • Cl
    CFRunLoopSource
    An object that represents an input source feeding events into a run loop.
  • Cl
    CFRunLoopObserver
    An object that receives callbacks at specific stages of a run loop's execution.
  • Cl
    CFRunLoopTimer
    An object that fires a callback at a scheduled time within a run loop.
  • St
    CFRunLoopMode
    A type that names a mode in which a run loop operates.
  • St
    CFRunLoopActivity
    Constants that identify the stages of a run loop reported to observers.
  • En
    CFRunLoopRunResult
    Constants that indicate why a run loop finished running.
  • St
    CFRunLoopSourceContext
    A structure that defines the callbacks and context for a version 0 run loop source.
  • St
    CFRunLoopSourceContext1
    A structure that defines the callbacks and context for a version 1 run loop source.
  • St
    CFRunLoopObserverContext
    A structure that supplies context to a run loop observer's callback.
  • St
    CFRunLoopTimerContext
    A structure that supplies context to a run loop timer's callback.

Ports, Sockets, and Streams 19

Communication primitives for Mach and message ports, sockets, file descriptors, and read and write streams.

  • Cl
    CFMachPort
    An object that wraps a Mach port as a run loop input source.
  • Cl
    CFMessagePort
    An object that enables synchronous message passing between threads or processes.
  • Cl
    CFSocket
    An object that wraps a BSD socket as a run loop input source.
  • Cl
    CFFileDescriptor
    An object that monitors a file descriptor for read and write availability within a run loop.
  • Cl
    CFReadStream
    An object that provides a stream of bytes for reading from a source.
  • Cl
    CFWriteStream
    An object that provides a stream of bytes for writing to a destination.
  • St
    CFMachPortContext
    A structure that supplies context to a Mach port's callback.
  • St
    CFMessagePortContext
    A structure that supplies context to a message port's callback.
  • St
    CFSocketSignature
    A structure that identifies a socket by its protocol family, type, and address.
  • St
    CFSocketCallBackType
    Options that identify the socket activities that trigger a callback.
  • St
    CFSocketContext
    A structure that supplies context to a socket's callback.
  • En
    CFSocketError
    Constants that indicate the result of a socket operation.
  • St
    CFFileDescriptorContext
    A structure that supplies context to a file descriptor's callback.
  • St
    CFStreamError
    A structure that describes an error that occurred on a stream.
  • St
    CFStreamPropertyKey
    Constants identifying configurable properties of a stream.
  • St
    CFStreamEventType
    Options that identify the events a stream reports to its client.
  • St
    CFStreamClientContext
    A structure that supplies context to a stream's client callback.
  • En
    CFStreamStatus
    Constants that indicate the current status of a stream.
  • En
    CFStreamErrorDomain
    Constants that identify the domain of an error reported by a stream.

URLs and Resources 9

Types for locating files and resources by URL, enumerating directory contents, and resolving bookmarks.

  • Cl
    CFURL
    An object that represents the location of a local or remote resource.
  • Cl
    CFURLEnumerator
    An object that enumerates the contents of a directory or a sequence of URLs.
  • En
    CFURLPathStyle
    Constants that specify the path style used when interpreting a file system path.
  • En
    CFURLComponentType
    Constants that identify the individual components of a URL.
  • En
    CFURLError
    Constants that identify errors that occur during URL operations.
  • St
    CFURLEnumeratorOptions
    Options that control how a URL enumerator traverses directory contents.
  • En
    CFURLEnumeratorResult
    Constants that indicate the outcome of advancing a URL enumerator.
  • St
    CFURLBookmarkCreationOptionsiOS 4.0+
    Options that control how a bookmark is created from a URL.
  • St
    CFURLBookmarkResolutionOptionsiOS 4.0+
    Options that control how a bookmark is resolved back into a URL.

Bundles and Plug-ins 3

Types for locating bundled resources, loading executable code, and managing plug-in instances.

  • Cl
    CFBundle
    An object that locates and loads code and resources stored in a bundle directory.
  • Cl
    CFPlugIn
    An object that manages a bundle containing loadable executable code as a plug-in.
  • Cl
    CFPlugInInstance
    An object that represents an instance of a type vended by a plug-in factory.

Property Lists 2

Formats and options governing the serialization and mutability of property list data.

  • En
    CFPropertyListFormat
    Constants that specify the serialization format of a property list.
  • St
    CFPropertyListMutabilityOptions
    Options that specify the mutability of objects created when reading a property list.

Notifications and User Interaction 4

Types for distributing notifications and presenting system alert dialogs to the user.

  • Cl
    CFNotificationCenter
    An object that delivers notifications to registered observers within or across processes.
  • St
    CFNotificationName
    A type that names a notification distributed by a notification center.
  • En
    CFNotificationSuspensionBehavior
    Constants that specify how notifications are handled while an application is suspended.
  • Cl
    CFUserNotification
    An object that presents a system alert dialog and reports the user's response.

Geometry 6

Value types for representing coordinates, dimensions, rectangles, and affine transformations.

  • St
    CGPoint
    A structure that represents a location in a two-dimensional coordinate system.
  • St
    CGSize
    A structure that represents a width and a height.
  • St
    CGVector
    A structure that represents a change in position in two dimensions.
  • St
    CGRect
    A structure that represents a rectangle as an origin point and a size.
  • St
    CGAffineTransform
    A structure that represents an affine transformation matrix for two-dimensional coordinates.
  • St
    CGAffineTransformComponents
    A structure that decomposes an affine transform into scale, rotation, shear, and translation.

Memory, Errors, and Identity 9

Foundational helper types for allocation, error reporting, file security, unique identifiers, and value comparison.

  • Cl
    CFAllocator
    An object that allocates, reallocates, and deallocates memory for Core Foundation objects.
  • St
    CFAllocatorContext
    A structure that defines the callbacks and context for a custom allocator.
  • Cl
    CFError
    @typedef CFErrorRef
  • Cl
    CFFileSecurity
    An object that encapsulates a file's ownership, permission, and access control information.
  • St
    CFFileSecurityClearOptionsiOS 6.0+
    Options that specify which attributes to clear from a file security object.
  • Cl
    CFUUID
    An object that represents a universally unique 128-bit identifier.
  • St
    CFUUIDBytes
    A structure that holds the raw 16-byte value of a universally unique identifier.
  • St
    CFRange
    A structure that represents a contiguous range as a location and length.
  • En
    CFComparisonResult
    Constants that indicate whether a value is ordered before, equal to, or after another.

Byte Order 3

Types describing endianness and the byte-swapped representations of floating-point values.

  • St
    __CFByteOrder
    A type that identifies a platform's byte order as big-endian, little-endian, or unknown.
  • St
    CFSwappedFloat32
    A structure that holds a byte-swapped 32-bit floating-point value.
  • St
    CFSwappedFloat64
    A structure that holds a byte-swapped 64-bit floating-point value.

Structures 1

  • St
    CGFloatiOS 2.0+

Enumerations 1

  • En
    CGRectEdge

Type Aliases 70

  • Ty
    CFArrayRetainCallBack
    @typedef CFArrayCallBacks
  • Ty
    CFArrayReleaseCallBack
  • Ty
    CFArrayCopyDescriptionCallBack
  • Ty
    CFArrayEqualCallBack
  • Ty
    CFArrayApplierFunction
    @typedef CFArrayApplierFunction
  • Ty
    CFBagRetainCallBack
  • Ty
    CFBagReleaseCallBack
  • Ty
    CFBagCopyDescriptionCallBack
  • Ty
    CFBagEqualCallBack
  • Ty
    CFBagHashCallBack
  • Ty
    CFBagApplierFunction
  • Ty
    CFAllocatorTypeID
  • Ty
    CFTypeID
  • Ty
    CFOptionFlags
  • Ty
    CFHashCode
  • Ty
    CFIndex
Show 54 more
  • Ty
    CFTypeRef
  • Ty
    CFPropertyList
  • Ty
    CFComparatorFunction
  • Ty
    CFAllocatorRetainCallBack
  • Ty
    CFAllocatorReleaseCallBack
  • Ty
    CFAllocatorCopyDescriptionCallBack
  • Ty
    CFAllocatorAllocateCallBack
  • Ty
    CFAllocatorReallocateCallBack
  • Ty
    CFAllocatorDeallocateCallBack
  • Ty
    CFAllocatorPreferredSizeCallBack
  • Ty
    CFBinaryHeapApplierFunction
    @typedef CFBinaryHeapApplierFunction
  • Ty
    CFBit
  • Ty
    CFBundleRefNum
  • Ty
    CFByteOrder
  • Ty
    CFTimeInterval
  • Ty
    CFAbsoluteTime
  • Ty
    CFDictionaryRetainCallBack
    @typedef CFDictionaryKeyCallBacks
  • Ty
    CFDictionaryReleaseCallBack
  • Ty
    CFDictionaryCopyDescriptionCallBack
  • Ty
    CFDictionaryEqualCallBack
  • Ty
    CFDictionaryHashCallBack
  • Ty
    CFDictionaryApplierFunction
    @typedef CFDictionaryApplierFunction
  • Ty
    CFErrorDomain
  • Ty
    CFFileDescriptorNativeDescriptor
  • Ty
    CFFileDescriptorCallBack
  • Ty
    CFMachPortCallBack
  • Ty
    CFMachPortInvalidationCallBack
  • Ty
    CFMessagePortCallBack
  • Ty
    CFMessagePortInvalidationCallBack
  • Ty
    CFNotificationCallback
  • Ty
    CFPlugInDynamicRegisterFunction
  • Ty
    CFPlugInUnloadFunction
  • Ty
    CFPlugInFactoryFunction
  • Ty
    CFPlugInInstanceGetInterfaceFunction
  • Ty
    CFPlugInInstanceDeallocateInstanceDataFunction
  • Ty
    CFRunLoopObserverCallBack
  • Ty
    CFRunLoopTimerCallBack
  • Ty
    CFSetRetainCallBack
    @typedef CFSetRetainCallBack
  • Ty
    CFSetReleaseCallBack
    @typedef CFSetReleaseCallBack
  • Ty
    CFSetCopyDescriptionCallBack
    @typedef CFSetCopyDescriptionCallBack
  • Ty
    CFSetEqualCallBack
    @typedef CFSetEqualCallBack
  • Ty
    CFSetHashCallBack
    @typedef CFSetHashCallBack
  • Ty
    CFSetApplierFunction
    @typedef CFSetApplierFunction
  • Ty
    CFSocketCallBack
  • Ty
    CFSocketNativeHandle
  • Ty
    CFReadStreamClientCallBack
  • Ty
    CFWriteStreamClientCallBack
  • Ty
    CFStringEncoding
  • Ty
    CFTreeRetainCallBack
    @typedef CFTreeRetainCallBack
  • Ty
    CFTreeReleaseCallBack
    @typedef CFTreeReleaseCallBack
  • Ty
    CFTreeCopyDescriptionCallBack
    @typedef CFTreeCopyDescriptionCallBack
  • Ty
    CFTreeApplierFunction
    @typedef CFTreeApplierFunction
  • Ty
    CFURLBookmarkFileCreationOptions
  • Ty
    CFUserNotificationCallBack

Extends 12

UInt8Int8UInt16Int16UInt32Int32UInt64Int64UIntIntDoubleFloat
← Foundation, System & Concurrency