GNUStep is not the same as Apple's Foundation. I don't know much about how GNUStep is implemented, but in Apple's Foundation, NS and CF counterparts are very closely linked indeed. As you say, we don't have the source for Foundation, but there are still many ways to detect integration between the two. One really easy-to-spot one is just to inspect the class of many Foundation objects:
NSMutableString *string = @"Foo".mutableCopy;
NSLog(@"%@", NSStringFromClass(string.class));
This little program outputs __NSCFString
, a clue that CFString
's implementation is indeed being used under the hood. Specifically, NSString
and CFString
(as well as NSArray
and CFArray
, NSDictionary
and CFDictionary
, and many other Foundation and CF types) are toll-free bridged—this means that their internal structures are designed to be exactly the same, such that you can actually convert one to the other with a simple typecast, with no expensive conversion process. So NSArray
doesn't just use CFArray
, it actually is a CFArray
.
Of course, since it's allowed to make your own private subclasses of classes like NSString
, NSArray
, et al., this means that for the bridging to work, the CF functions need to be able to handle the case where what looks like a CF object is actually an Objective-C subclass, and use the Objective-C implementation if it is. And for that reason, CoreFoundation objects, which we do have much of the sources to, do actually make many references to their NS equivalents, such as the CFArray
source linked below, which contains references to NSArray
.
https://opensource.apple.com/source/CF/CF-1153.18/CFArray.c.auto.html