开发者

What does CF in CFnumber,CFstring etc in xcode application mean?

I have minimum exposure to Xcode and i/o kit. I came across terms like CFString, CFNumber etc. Whether this CF have any particular meaning like these strings and numbers inh开发者_运维技巧erited from C or like C string or numbers. I just want to know what CF refers to.

Thanks in advance


CFString, CFNumber etc., are declared in Core Foundation Framework, and this makes it obvious that CF is the abbreviation of Core Foundation. We do create objects of those CF types like CF[Type]Ref,

CFStringRef str;

Note that here we not using *, though CFStringRef is a reference type. Most of this CFTypes are "toll-free bridged” with their Core Foundation counter parts. Which means they can be used interchangeably. For example, CFStringRef is "toll-free bridged” with its counter part NSString, and both the following lines are completely valid.

CFStringRef str = (CFStringRef)aNSStringObject; // Valid
NSString *str = (NSString *)aCFStringRefObject; // Valid 


It stands for Core Foundation, which is Apple's C-based API that:

provides the fundamental data types and essential services that underlie both the Cocoa and Carbon environments on Mac OS X.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜