From iPhone Development Wiki
Jump to: navigation, search
Public Framework
Availabile 1.0 – present
Class Prefix CF

CoreFoundation is a cross-platform C-based API that provides reference-counted data structures, IPC facilities, run loops, etc. A subset of it is open-sourced as "CF-Lite".

This framework also provides some crucial Objective-C classes such as NSObject, NSString, NSArray, etc.

For one example of using CoreFoundation version numbers, see Updating extensions for iOS 7#Detecting iOS 7.


Firmware 2.0 2.1 2.2 3.0 3.1 3.2 4.0 4.1 4.2 4.3 5.0 5.1
CoreFoundation version 478.23 478.26.1 478.29 478.47.7 478.52 478.61 550.32 550.38.1 550.52 550.58.1 675.00 690.10
Firmware 6.0 6.1 7.0 7.1 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3
CoreFoundation version 793.00 847.20 847.24 1140.10 1141.14 1142.16 1144.17 1145.15 1240.10 1241.11 1242.13 1280.38
Firmware 10.0 10.1 10.2
CoreFoundation version 1348.00 1348.22

Parameters for CoreFoundation applications

CoreFoundation recognizes the following special command-line arguments:

Flag Purpose
-AppleLanguages "(lang1, lang2, ...)" Set the list of languages for localization.

Environment variables

Application built with CoreFoundation will recognize the following environment variables

Name Default Purpose
__CF_USER_TEXT_ENCODING[1] 0x1f5:0:0 (mobile) or 0x0:0:0 (root) Override the default text encoding.
CFFIXED_USER_HOME NULL The home directory recognized by CoreFoundation. (Note that the system environment variable HOME is also in use.)
CFPREFERENCES_LOG_EQUAL_VALUES false Displays a debug-level log when trying to set an unmodified value in preferences (NSUserDefaults).
CFBundleDisableStringsSharing false Do not share *.strings files. (?)
IPHONE_SIMULATOR_DEVICE iPhone Used by the internal _CFGetProductName to get the current platform. This environment variable will be checked only when sysctl hw.machine returns a value other than iPhone, iPod or iPad (what about AppleTV?).
CFPropertyListAllowImmutableCollections false Force collections (array, dictionary) parsed from property lists to be immutable.
CFUUIDVersionNumber[2] 4 UUID version to use. Only supports 1 or 4.
false Enable check for expanded character sets. When an expanded set is detected, a warning "An expanded CFMutableCharacter has been detected. Recommend to compact with CFCharacterSetCreateCopy" will be printed.
OAKeepAllocationStatistics[3] false  ?
NSObjCMessageLoggingEnabled[4] no -
NSZombieEnabled[5][6] no Use "zombies" for easier detection on misusing deallocated objects.
NSDeallocateZombies[5] no
CFZombieLevel[7] 0
CFStringDisableROM false  ?
CFLOG_FORCE_STDERR false Stream error from CFLog to stderr too.
CFNETWORK_LIBRARY_PATH /System/Library/Frameworks/CFNetwork.framework/CFNetwork Manually set the path of the CFNetwork binary.
NSAutoreleaseHaltOnFreedObject no Kill the process immediately when calling -autorelease on a freed object.
NSAutoreleaseHaltOnNoPool no Kill the process immediately when calling -autorelease without a pool.
CFBundleUseDYLD  ? Use low-level dyld(3) functions instead of dlopen(3)/etc. to check if a bundle is loaded or not.
CFProcessPath - Manually set the process path.
- Various CF functions depend on these info.


  5. 5.0 5.1