I have been programming in Objective-C Cocoa for a little while using NSObjects etc. I see that there is another framework: CoreFoundation.As i look it over, it seems to be a C-Style framework.
So I have some curiosities i'd like clarified. I've googled but found no direct answer.
These are some of the questions i have. If anyone can provide an answer, or provide me with resources to read about it, that would be great. I am wondering if its worth learning more about the framework.
The Foundation framework provides a base layer of functionality for apps and frameworks, including data storage and persistence, text processing, date and time calculations, sorting and filtering, and networking.
Core Foundation is a general-purpose C framework whereas Foundation is a general-purpose Objective-C framework. Both provide collection classes, run loops, etc, and many of the Foundation classes are wrappers around the CF equivalents.
History: The Foundation dates to ~1993/1994 and the APIs therein were a part of the OpenStep APIs published by NeXT.
What is the purpose of CoreFoundation framework?
CF was created during the transition of Mac OS to Mac OS X to help support that transition. Initially, it was done both for speed and to allow purely non-Objective-C programs to be written. Over time, that has proven to be a non-issue and CF has more and more bits that are implemented in Objective-C (have a look at the CoreFoundation binary using something like otool).
CFLite is a light-weight, portable, pure-C (IIRC) variant.
Doesn't the Cocoa Framework provide every thing that's needed already?
More or less. And, certainly moreso for building GUI applications on either iOS or OS X.
Does the CoreFoundation Framework provide any advantages that the CocoaFramework does not provide?
Several, but generally at a cost of decreased simplicity and increased fragility.
For example, the CF collections allow you to completely customize how memory is managed and objects are identified; you can provide custom allocation/free/hashing/comparison hooks. Through this, you can "easily" encapsulate non-Objective-C types in CF collections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With