The Cocoa Environment
Introducing Cocoa
1. Cocoa is a set of object-oriented frameworks that provides a runtime environment for applications running in Mac OS X and iOS.
2. Cocoa presents two faces; it has a runtime aspect and a development aspect.
3. Cocoa is an integrated suite of object-oriented software components—classes
4. The most important Cocoa class libraries come packaged in two core frameworks for each platform: Foundation and AppKit for Mac OS X, and Foundation and UIKit for iOS. As with all frameworks, these contain not only a dynamically sharable library, but header files, API documentation, and related resources.
How Cocoa Fits into iOS
Cocoa in the architecture of iOS
1. Application Layer
2. Cocoa Touch Layer (The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.)
3. Media Layer (Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback)
4. Core Services Layer (Foundation, Core Location, Core Motion, and Core Foundation, Core Data)
5. Core OS Layer
2. Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X.
3.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework. These are the core Cocoa frameworks in iOS:
- UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit, see“UIKit (iOS).”
- Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; see“Foundation”
Foundation Framework
UIKit Framework