The Core Foundation Framework (corefoundation.framework) is a set of C-language interfaces that provide basic data management and service capabilities for iOS applications. The following lists the data that the framework supports for management and what services are available:
-
Group data types (arrays, collections, etc.)
-
Package
-
String Management
-
Date and time management
-
RAW Data Block Management
-
Preference Management
-
URL and Data flow operations
-
Threading and Runloop
-
Port and Soket Communication
The Core Foundation framework is closely related to the foundation framework, which provides interfaces for the same functionality, but the foundation framework provides the OBJECTIVE-C interface. If you use the foundation object with the core foundation type, you can take advantage of the "toll-free bridging" between the two frameworks. The so-called toll-free bridging is that you can use some of the types in the core Foundatio and foundation frameworks at the same time in a framework's methods or functions. Many data types support this feature, including group and string data types. The class and type descriptions for each frame are toll-free bridged for an object and what object bridging should be described.
For further information, please read the core Foundation Framework reference.
Objective-c the transition between the pointer and the corefoundation pointer "
Arc only manages objective-c pointers (retain, release, autorelease), does not manage corefoundation pointers, cf pointers are managed manually by manual cfretain and cfrelease, note, There is no autorelease in cf.
The cocoafoundation pointer and the corefoundation pointer conversion, need to consider is the ownership of the object of the point. ARC provides 3 modifiers to manage.
1. __bridge, do nothing, just convert. In this case:
i). Conversion from cocoa to core requires manual cfretain, otherwise the pointer passed out when the cocoa pointer is released is invalid.
II). Conversion from core to cocoa requires manual cfrelease, otherwise the object reference count is still 1 after the cocoa pointer is released and will not be destroyed.
2. __bridge_retained, automatically call Cfretain after conversion, that is, to help automatically solve the above I situation.
2. __bridge_transfer, automatically call cfrelease after conversion, that is, to help automatically solve the situation of the above II.
The difference between the iOS Core Foundation framework and the Cocoa Foundation framework