Access essential data types, collections, and operating-system services to define the base layer of functionality for your app.


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. The classes, protocols, and data types defined by Foundation are used throughout the macOS, iOS, watchOS, and tvOS SDKs.



Numbers, Data, and Basic Values

Work with primitive values and other fundamental types used throughout Cocoa.

Strings and Text

Create and process strings of Unicode characters, use regular expressions to find patterns, and perform natural language analysis of text.


Use arrays, dictionaries, sets, and specialized collections to store and iterate groups of objects or values.

Dates and Times

Compare dates and times, and perform calendar and time zone calculations.

Units and Measurement

Label numeric quantities with physical dimensions to allow locale-aware formatting and conversion between related units.

Data Formatting

Convert numbers, dates, measurements, and other values to and from locale-aware string representations.

Filters and Sorting

Use predicates, expressions, and sort descriptors to examine elements in collections and other services.

App Support

Task Management

Manage your app's work and its interaction with the user and the system.


Access assets and other data bundled with your app.


Design patterns for broadcasting information and for subscribing to broadcasts.

App Extension Support

Manage the interaction between an app extension and its hosting app.

Errors and Exceptions

Respond to problem situations in your interactions with APIs, and fine-tune your app for better debugging.

Scripting Support

Allow users to control your app with AppleScript and other automation technologies, or run scripts from within your app.

Files and Data Persistence

File System

Create, read, write, and examine files and folders in the file system.

Archives and Serialization

Convert objects and values to and from property list, JSON, and other flat binary representations.


Persistently store domain-scoped pieces of information used to configure your app.


Search for files and other items on the local device, and index your app's content for searching.


Manage files and key-value data that are automatically synchronized among a user's iCloud devices.


URL Loading System

Interact with URLs and communicate with servers using standard Internet protocols.


Advertise services for easy discovery on local networks, or discover services advertised by others.

Low-Level Utilities


Manage secure interprocess communication.

Object Runtime

Get low-level support for basic Objective-C features, Cocoa design patterns, and Swift integration.

Processes and Threads

Manage your app's interaction with the host operating system and other processes, and implement low-level concurrency features.

Streams, Sockets, and Ports

Use low-level Unix features to manage input and output among files, processes, and the network.

Property List Keys

Property List Key NSAppTransportSecurity

A description of changes made to the default security for HTTP connections.

Name: App Transport Security Settings
Property List Key NSAppleScriptEnabled

A Boolean value indicating whether AppleScript is enabled.

Name: Scriptable
Property List Key NSExtension

The properties of an app extension.

Property List Key NSExtensionFileProviderDocumentGroup

The identifier of a shared container that can be accessed by a document picker and its associated file provider.

Name: App group used for document storage
Property List Key NSExtensionFileProviderSupportsEnumeration

A Boolean value indicating whether the file provider can enumerate its content.

Name: File Provider supports Enumeration
Property List Key NSHighResolutionCapable

A Boolean value indicating whether the Cocoa app supports high-resolution displays.

Name: High Resolution Capable
Property List Key NSHumanReadableCopyright

A human-readable copyright notice for the bundle.

Name: Copyright (human-readable)
Property List Key NSJavaRoot

The root directory for the app’s Java class files.

Name: Java root directory
Property List Key NSMainNibFile

The name of an app’s main user interface file.

Name: Main nib file base name
Property List Key NSMainNibFile~ipad
Name: Main nib file base name (iPad)
Property List Key NSMainNibFile~iphone
Name: Main nib file base name (iPhone)
Property List Key NSMainStoryboardFile

The name of an app's storyboard resource file.

Name: Main storyboard file base name
Property List Key NSPrincipalClass

The name of the bundle’s main class.

Name: Principal class
Property List Key NSSupportsAutomaticGraphicsSwitching

A Boolean value indicating whether an OpenGL app may utilize the integrated GPU.

Name: Supports Automatic Graphics Switching
Property List Key NSSupportsPurgeableLocalStorage

A Boolean value indicating whether the app continues working if the system purges the local storage.


Foundation Data Types

This document describes the data types and constants found in the Foundation framework.