Retired Document
Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid.
Cocoa (Touch)
Cocoa and Cocoa Touch are the application development environments for OS X and iOS, respectively. Both Cocoa and Cocoa Touch include the Objective-C runtime and two core frameworks:
Cocoa, which includes the Foundation and AppKit frameworks, is used for developing applications that run on OS X.
Cocoa Touch, which includes Foundation and UIKit frameworks, is used for developing applications that run on iOS.
The Frameworks
The Foundation framework implements the root class, NSObject
, which defines basic object behavior. It implements classes that represent primitive types (for example, strings and numbers) and collections (for example, arrays and dictionaries). Foundation also provides facilities for internationalization, object persistence, file management, and XML processing. You can use its classes to access underlying system entities and services, such as ports, threads, locks, and processes. Foundation is based on the Core Foundation framework, which publishes a procedural (ANSI C) interface.
You use the AppKit and UIKit frameworks for developing an application’s user interface. These two frameworks are equivalent in purpose but are specific to a platform. They include classes for event handling, drawing, image-handling, text processing, typography, and interapplication data transfer. They also include user-interface elements such as table views, sliders, buttons, text fields, and alert dialogs.
The Language
Objective-C is the native, primary language for developing Cocoa and Cocoa Touch applications. However, projects for Cocoa and Cocoa Touch applications may include C++ and ANSI C code. Additionally, you can develop Cocoa applications using scripting languages that are bridged to the Objective-C runtime, such as PyObjC and RubyCocoa.
Copyright © 2018 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2018-04-06