'Foundation.fx' is probably the most critical framework for any Cocoa app, because — as the name implies — it provides much of the foundation classes that make up an application on the Objective-C runtime. This includes most of the standard classes with NS* prefixes (aside from Mac GUI classes in AppKit.fx), from simple and essential types such as NSString, NSArray and the like to classes that provide access to core OS services, such as NSFileManager for disk access, NSNotificationCenter for working with notifications, NSURL* classes to work with network requests, and many many more.

Foundation is one of the frameworks shared between iOS and Mac OS X, and you will find that the vast majority of its content is identical on both platforms. This means that any code you write with those classes can, most likely, be shared in applications for both. This comes in handy if you are creating an app with both Mac and iOS versions, as much of the non-visual, back-end code can be shared.

There are, however, also platform-specific classes in Foundation. For example, the NSUserNotificationCenter class, new since OS X 10.8 Mountain Lion, which lets your application interact with the notification center UI, is available on the OS X SDK only, as are the NSXML* classes that provide an extensive library for working with XML files.

All types from Foundation.fx are exposed in the Foundation Namespace.

Note: A Cocoa.framework (and matching .fx) exists in the OS X SDK. This framework is merely a bundle of Foundation and AppKit, and not to be confused with our general use of the term "Cocoa" to refer to the entire platform.

You can find the complete documentation of the Foundation framework here:

See Also