0 votes
in Technology by (323k points)

When might you use a CFArray/Dictionary instead of a NSArray/Dictionary?

1 Answer

0 votes
by (323k points)

Core Foundation is the brains of the operation. It’s written mostly in C. It was created with Apple’s acquisition of NEXT and their APIs and owes a lot to them. The NS* classes are often just Objective C abstract interfaces built on top of the CF* types. So, when you ask why both CFArray and NSArray exist, the answer is that they actually don’t. NSArrays are CFArrays, NSStrings are CFStrings, etc. That’s why toll-free-bridging is possible.

...