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.
Note: The term “Cocoa” has been used to refer generically to any class or object that is based on the Objective-C runtime and inherits from the root class, NSObject. The terms “Cocoa” or “Cocoa Touch” are also used when referring to application development using any programmatic interface of the respective platforms.
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.
Cocoa和Cocoa Touch是用于OSX和iOS的应用开发环境。Cocoa用于OSX应用开发,而Cocoa Touch则专为iOS应用设计。它们都基于Objective-C运行时,并包含Foundation和核心框架。文章详细介绍了这两个框架及其在系统访问、国际化、对象持久化等方面的用法。
1087

被折叠的 条评论
为什么被折叠?



