Foundation Kit

Last updated

The Foundation Kit, or just Foundation for short, is an Objective-C framework in the OpenStep specification described by NeXT Computer, Inc.. It provides basic classes such as wrapper classes and data structure classes. This framework uses the prefix NS (for NeXTSTEP [1] ). It is also part of Cocoa and of the Swift standard library.

Contents

Classes

NSObject

This class is the most common base class for Objective-C hierarchies and provides standard methods for working with objects by managing the memory associated with them and querying them.

NSString and NSMutableString

A class used for string manipulation, representing a Unicode string (most typically using UTF-16 as its internal format). NSString is immutable, and thus can only be initialized but not modified. NSMutableString is a modifiable version.

NSValue and NSNumber

NSValue is a wrapper class for C data types, and NSNumber is a wrapper class for C number data types such as int, double, and float. The data structures in Foundation Kit can only hold objects, not primitive types, so wrappers such as NSValue and NSNumber are used in those data structures.

NSArray and NSMutableArray

A dynamic array of objects, supporting constant-time indexing. NSArray is an immutable version that can only be initialized with objects but not modified. NSMutableArray may be modified by adding and removing objects.

NSDictionary and NSMutableDictionary

An associative data container of key-value pairs with unique keys. Searching and element addition and removal (in the case of NSMutableDictionary) is faster-than-linear. However, the order of the elements within the container is not guaranteed.

NSSet and NSMutableSet

An associative container of unique keys, similar to NSDictionary, with the difference that members do not contain a data object.

NSData and NSMutableData

A wrapper for raw byte data. An object of this type can dynamically allocate and manage its data, or it can refer to data owned by and managed by something else (such as a static numeric array).

NSDate, NSTimeZone and NSCalendar

Classes that store times and dates and represent calendrical information. They offer methods for calculating date and time differences. Together with NSLocale, they provide methods for displaying dates and times in many formats, and for adjusting times and dates based on location in the world.

Major implementations

macOS and iOS

The Foundation Kit is part of the macOS Cocoa API. Beginning as the successor to OPENSTEP/Mach, this framework has deviated from OpenStep compliance, and is in some places incompatible. The Foundation Kit is in the iOS Cocoa Touch API. This framework is based on the macOS Cocoa.

GNUstep

The Foundation Kit is implemented in GNUstep's Base Package (libs-base). This implementation is mostly comparable (4 classes are missing) and aims to be comparable with both the OpenStep API and later macOS additions. The missing classes have been dropped by Apple as well. [2]

Cocotron

The Foundation Kit is implemented in Cocotron, an open-source implementation of Cocoa. It is also a part of Darling.

PureFoundation

PureFoundation is an open-source implementation of Foundation that implements Foundation by wrapping Core Foundation, just like in Cocoa, rather than create a separate Foundation from scratch like GNUstep and Cocotron.

SwiftFoundation

SwiftFoundation (swift-corelibs-foundation) is Apple's open-source Swift implementation of the Foundation API for platforms where there is no Objective-C runtime. It also includes an implementation of Core Foundation. [3]

ApportableFoundation

ApportableFoundation is an implementation of Foundation Kit (Foundation, CoreFoundation, and CFNetwork) based on Apple's CFLite release. It works on Android and other Linux systems, and makes up part of the Darling macOS translation layer for Linux.

See also

Related Research Articles

<span class="mw-page-title-main">NeXTSTEP</span> Operating system from NeXT Computer

NeXTSTEP is a discontinued object-oriented, multitasking operating system based on the Mach kernel and the UNIX-derived BSD. It was developed by NeXT Computer, founded by Steve Jobs, in the late 1980s and early 1990s and was initially used for its range of proprietary workstation computers such as the NeXTcube. It was later ported to several other computer architectures.

Darwin is the core Unix operating system of macOS, iOS, watchOS, tvOS, iPadOS, visionOS, and bridgeOS. It previously existed as an independent open-source operating system, first released by Apple Inc. in 2000. It is composed of code derived from NeXTSTEP, FreeBSD, other BSD operating systems, Mach, and other free software projects' code, as well as code developed by Apple.

<span class="mw-page-title-main">OpenStep</span> Defunct object-oriented application programming interface specification

OpenStep is an object-oriented application programming interface (API) specification developed by NeXT. It provides a framework for building graphical user interfaces (GUIs) and developing software applications. OpenStep was designed to be platform-independent, allowing developers to write code that could run on multiple operating systems, including NeXTSTEP, Windows NT, and various Unix-based systems. It has influenced the development of other GUI frameworks, such as Cocoa for macOS, and GNUstep.

Cocoa is Apple's native object-oriented application programming interface (API) for its desktop operating system macOS.

<span class="mw-page-title-main">GNUstep</span> Open source widget toolkit and application development tools

GNUstep is a free software implementation of the Cocoa Objective-C frameworks, widget toolkit, and application development tools for Unix-like operating systems and Microsoft Windows. It is part of the GNU Project.

Carbon was one of two primary C-based application programming interfaces (APIs) developed by Apple for the macOS operating system. Carbon provided a good degree of backward compatibility for programs that ran on Mac OS 8 and 9. Developers could use the Carbon APIs to port (“carbonize”) their “classic” Mac applications and software to the Mac OS X platform with little effort, compared to porting the app to the entirely different Cocoa system, which originated in OPENSTEP. With the release of macOS 10.15 Catalina, the Carbon API was officially discontinued and removed, leaving Cocoa as the sole primary API for developing macOS applications.

Portable Distributed Objects (PDO) is an application programming interface (API) for creating object-oriented code that can be executed remotely on a network of computers. It was created by NeXT Computer, Inc. using their OpenStep system, whose use of Objective-C made the package very easy to write. It was characterized by its very light weight and high speed in comparison to similar systems such as CORBA.

<span class="mw-page-title-main">WebObjects</span> Java web application server and framework originally developed by NeXT Software

WebObjects is a discontinued Java web application server and a server-based web application framework originally developed by NeXT Software, Inc.

Apple events are the message-based interprocess communication mechanism in Mac OS, first making an appearance in System 7 and supported by every version of the classic Mac OS since then and by macOS. Apple events describe "high-level" events such as "open document" or "print file", whereas earlier OSs had supported much more basic events, namely "click" and "keypress". Apple events form the basis of the Mac OS scripting system, the Open Scripting Architecture.

<span class="mw-page-title-main">Rhapsody (operating system)</span> Apple operating system

Rhapsody is an operating system that was developed by Apple Computer after its purchase of NeXT in the late 1990s. It is the fifth major release of the Mach-based operating system that was developed at NeXT in the late 1980s, previously called OPENSTEP and NEXTSTEP. Rhapsody was targeted to developers for a transition period between the Classic Mac OS and Mac OS X. Rhapsody represented a new and exploratory strategy for Apple, more than an operating system, and runs on x86-based PCs and on Power Macintosh.

<span class="mw-page-title-main">AppKit</span> Graphical user interface toolkit

AppKit is a graphical user interface toolkit. It initially served as the UI framework for NeXTSTEP. Along with Foundation and Display PostScript, it became one of the core parts of the OpenStep specification of APIs. Later, AppKit and Foundation became part of Cocoa, the Objective-C API framework of macOS. GNUstep, GNU's implementation of the OpenStep/Cocoa API, also contains an implementation of the AppKit API.

Core Foundation is a C application programming interface (API) written by Apple Inc. for its operating systems, and is a mix of low-level routines and wrapper functions. Most Core Foundation routines follow a certain naming convention that deal with opaque objects, for example CFDictionaryRef for functions whose names begin with CFDictionary, and these objects are often reference counted (manually) through CFRetain and CFRelease. Internally, Core Foundation forms the base of the types in the Objective-C standard library and the Carbon API.

In the macOS, iOS, NeXTSTEP, and GNUstep programming frameworks, property list files are files that store serialized objects. Property list files use the filename extension .plist, and thus are often referred to as p-list files.

In NeXTSTEP, OPENSTEP, and their lineal descendants macOS, iOS, iPadOS, tvOS, and watchOS, and in GNUstep, a bundle is a file directory with a defined structure and file extension, allowing related files to be grouped together as a conceptually single item.

PyObjC is a bidirectional bridge between the Python and Objective-C programming languages, allowing programmers to use and extend existing Objective-C libraries, such as Apple's Cocoa framework, using Python.

The term target–action design paradigm refers to a kind of software architecture, where a computer program is divided into objects which dynamically establish relationships by telling each other which object they should target and what action or message to send to that target when an event occurs. This is especially useful when implementing graphical user interfaces, which are by nature event-driven.

Cocoa Touch is the application development environment for building software programs to run on iOS for the iPhone and iPod Touch, iPadOS for the iPad, watchOS for the Apple Watch, and tvOS for the Apple TV, from Apple Inc.

Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its NeXTSTEP operating system. Due to Apple macOS’s direct lineage from NeXTSTEP, Objective-C was the standard programming language used, supported, and promoted by Apple for developing macOS and iOS applications until the introduction of the Swift programming language in 2014.

The Cocoa text system is the linked network of classes, protocols, interfaces and objects that provide typography and text field editing capabilities and to Cocoa applications on Apple's macOS, where it is the primary text-handling system. Although "extremely complex", the standard text-handling abilities of the Cocoa text system have been widely praised as without peer. It is possible to implement a fully featured rich text editor in only a few lines of code.

References

  1. Bumgarner, Bill. "The NS prefix predated Sun signing on to implement the OpenStep spec by quite a bit".
  2. "OpenStep Compliance". GNUstep (Base). Retrieved 17 February 2020.
  3. "swift-corelibs-foundation". GitHub.