Difference between revisions of "CoreFoundation.framework"

From iPhone Development Wiki
Jump to: navigation, search
m (Versions)
(Environment variables)
Line 36: Line 36:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Name !! Purpose
+
! Name !! Default !! Purpose
 
|-
 
|-
| NSZombieEnabled<ref name="tn">http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html#SECFOUNDATION</ref><ref>http://www.cocoadev.com/index.pl?NSZombieEnabled</ref><br />NSDeallocateZombies<ref name="tn" /><br />CFZombieLevel<ref>http://www.cocoadev.com/index.pl?CFZombie</ref> || Use "zombies" for easier detection on misusing deallocated objects.
+
| __CF_USER_TEXT_ENCODING<ref name="tn2228">http://developer.apple.com/library/mac/technotes/tn2228/_index.html#//apple_ref/doc/uid/DTS40007991-CH1-SUBSECTION15</ref>
 +
| <tt>0x1f5:0:0</tt> (mobile) or <tt>0x0:0:0</tt> (root)
 +
| Override the default text encoding.
 
|-
 
|-
| __CF_DEBUG_EXPANDED_SET<br />CFCharacterSetCheckForExpandedSet || Enable check for expanded character sets. When an expanded set is detected, a message "An expanded CFMutableCharacter has been detected.  Recommend to compact with CFCharacterSetCreateCopy" will be printed.
+
| CFFIXED_USER_HOME || NULL || The home directory recognized by CoreFoundation. (Note that the system environment variable HOME is also in use.)
 
|-
 
|-
| CFBundleUseDYLD || Use low-level <tt>dyld(3)</tt> functions instead of <tt>dlopen(3)</tt>/etc. to check if a bundle is loaded or not.
+
| CFPREFERENCES_LOG_EQUAL_VALUES || false || Displays a debug-level log when trying to set an unmodified value in preferences (NSUserDefaults).
 
|-
 
|-
| CFProcessPath || Manually set the process path.
+
| CFBundleDisableStringsSharing || false || Do not share <tt>*.strings</tt> files. (?)
 
|-
 
|-
| OAKeepAllocationStatistics<ref>http://gcc.gnu.org/ml/gcc/2002-08/msg01225.html</ref> || ?
+
| IPHONE_SIMULATOR_DEVICE || <tt>iPhone</tt>
 +
| Used by the internal <tt>_CFGetProductName</tt> to get the current platform. This environment variable will be checked only when <tt>sysctl hw.machine</tt> returns a value other than <tt>iPhone</tt>, <tt>iPod</tt> or <tt>iPad</tt> (what about AppleTV?).
 
|-
 
|-
| CFBundleDisableStringsSharing || Do not share <tt>.strings</tt> files. (?)
+
| CFPropertyListAllowImmutableCollections || false || Force collections (array, dictionary) parsed from property lists to be immutable.
 
|-
 
|-
| CFPropertyListAllowImmutableCollections || Force collections (array, dictionary) parsed from property lists to be immutable.
+
| CFUUIDVersionNumber<ref>http://www.monen.nl/DevDoc/releasenotes/CoreFoundation/RN-CoreFoundation/index.html#//apple_ref/doc/uid/TP40000994-DontLinkElementID_4</ref>
 +
| 4
 +
| UUID version to use. Only supports 1 or 4.
 
|-
 
|-
| USER<br />HOME<br />PATH<br />DYLD_IMAGE_SUFFIX || Various CF functions depend on these info.
+
| __CF_DEBUG_EXPANDED_SET<br />CFCharacterSetCheckForExpandedSet
 +
| 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.
 
|-
 
|-
| CFFIXED_USER_HOME || Manually set the home directory.
+
| OAKeepAllocationStatistics<ref>http://gcc.gnu.org/ml/gcc/2002-08/msg01225.html</ref> || false || ?
 
|-
 
|-
| CFUUIDVersionNumber<ref>http://www.monen.nl/DevDoc/releasenotes/CoreFoundation/RN-CoreFoundation/index.html#//apple_ref/doc/uid/TP40000994-DontLinkElementID_4</ref> || UUID version to use. Only supports 1 or 4.
+
| NSObjCMessageLoggingEnabled<ref>http://developer.apple.com/library/mac/technotes/tn2004/tn2124.html#SECOBJECTIVEC</ref> || <tt>no</tt> || -
 
|-
 
|-
| CFLOG_FORCE_STDERR || Stream error from [[CFLog]] to stderr too.
+
| NSZombieEnabled<ref name="tn">http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html#SECFOUNDATION</ref><ref>http://www.cocoadev.com/index.pl?NSZombieEnabled</ref>
 +
| <tt>no</tt>
 +
| rowspan="3" | Use "zombies" for easier detection on misusing deallocated objects.
 
|-
 
|-
| TZFILE<br />TZ || Timezone info.
+
| NSDeallocateZombies<ref name="tn" />
 +
| no
 
|-
 
|-
| CFNETWORK_LIBRARY_PATH || Manually set the path of the CFNetwork binary.
+
| CFZombieLevel<ref>http://www.cocoadev.com/index.pl?CFZombie</ref>
 +
| 0
 +
|-
 +
| CFStringDisableROM || false || ?
 +
|-
 +
| CFLOG_FORCE_STDERR || false || Stream error from [[CFLog]] to stderr too.
 +
|-
 +
| CFNETWORK_LIBRARY_PATH || <tt>/System/Library/Frameworks/CFNetwork.framework/CFNetwork</tt> || Manually set the path of the CFNetwork binary.
 +
|-
 +
| NSAutoreleaseHaltOnFreedObject || <tt>no</tt> || Kill the process immediately when calling <tt>-autorelease</tt> on a freed object.
 +
|-
 +
| NSAutoreleaseHaltOnNoPool || <tt>no</tt> || Kill the process immediately when calling <tt>-autorelease</tt> without a pool.
 +
|-
 +
| CFBundleUseDYLD || ? || Use low-level <tt>dyld(3)</tt> functions instead of <tt>dlopen(3)</tt>/etc. to check if a bundle is loaded or not.
 +
|-
 +
| CFProcessPath ||  - || Manually set the process path.
 +
|-
 +
| USER<br />HOME<br />PATH<br />DYLD_IMAGE_SUFFIX<br />TZFILE<br />TZ || - || Various CF functions depend on these info.
 
|}
 
|}
  

Revision as of 09:45, 18 March 2011

CoreFoundation.framework
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.

Versions

Firmware 2.0 2.1 2.2 3.0 3.1 3.2 4.0 4.1 4.2 4.3
SourceCache 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
dylib 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

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.
__CF_DEBUG_EXPANDED_SET
CFCharacterSetCheckForExpandedSet
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.
USER
HOME
PATH
DYLD_IMAGE_SUFFIX
TZFILE
TZ
- Various CF functions depend on these info.

References