Most of the time in the development process is using the Uikit and foundation framework, Uikit provides controls such as UIView and UIButton, and the foundation provides data structures such as nsarray,nsdictionary, The combination of the two can solve most of the problems, but sometimes it requires the underlying framework, which usually starts with the core, such as the core Text,core graphics and core Video. They are all C-based APIs on the core Foundation.
The types in the Core Foundation are all opaque types (opaque type). Only object references can be used in the core foundation, and the base type Cftyperef is actually a void* type, so that defining certain variables as CFTYPEREF types can facilitate the polymorphism of some functions. (such as Cfequal,cfhash,cfrelease,cfretain functions)
In addition to cftyperef, other opaque types are structs, and the common combinations are as follows:
typedef const STRUCT __cfstring * CFSTRINGREF;
typedef STRCT __cfstring * CFMUTABLESTRINGREF;
This way the compiler can check for the correctness of the const, but be aware that this is not a true inheritance. In core Foudation, if a class has several subclasses, it is generally the void* type. For example, the Cfpropertylistref subclass has (Cfstring,cfdate,cfnumber). Fortunately this is not the case, most types are struct or const struct.
Core Foundation Framework (1) Basic introduction