iOS开发笔记 2、Cocoa简明

简介: 历史 NeXSTEP Many years ago Cocoa was known as NeXTSTEP . NeXT Computer developed and released version 1.
历史

NeXSTEP

Many years ago Cocoa was known as NeXTSTEP . NeXT Computer developed and released version 1.0 ofNeXTSTEP in September of 1989, and versions 2.0 and 3.0 followed not far behind (in 1990 and 1992,respectively). In this early phase, NEXTSTEP was more than an application environment; the term referred tothe entire operating system, including the windowing and imaging system (which was based on DisplayPostScript), the Mach kernel, device drivers, and so on.Back then, there was no Foundation framework. Indeed, there were no frameworks; instead, the softwarelibraries (dynamically shared) were known as kits, the most prominent of them being the Application Kit.Much of the role that Foundation nowoccupieswas taken by an assortment of functions, structures, constants,and other types. The Application Kit itself had a much smaller set of classes than it does today. In addition to the Application Kit, the early NeXTSTEP included the Sound Kit and the Music Kit, librariescontaining a rich set of Objective-C classes that provided high-level access to the Display Postscript layer foraudio and music synthesis.

 

OpenStep

In early 1993 NeXTSTEP 3.1 was ported to (and shipped on) Intel, Sparc, and Hewlett-Packard computers.NeXTSTEP 3.3 alsomarked amajor new direction, for it included a preliminary version of Foundation. Aroundthis time (1993), the OpenStep initiative also took form. OpenStep was a collaboration between Sun andNeXT to port the higher levels of NeXTSTEP (particularly the Application Kit and Display PostScript) to Solaris.The “Open” in the name referred to the open API specification that the companies would publish jointly. Theofficial OpenStep API, published in September of 1994, were the first to split the API between Foundationand Application Kit and the first to use the “NS” prefix.

By June 1996 NeXT had ported and shipped versions of OpenStep 4.0 that could run Intel, Sparc, andHewlett-Packard computers as well as an OpenStep runtime that could run on Windows systems. Sun alsofinished their port of OpenStep to Solaris and shipped it as part of their Network Object ComputingEnvironment. OpenStep, however, never became a significant part of Sun’s overall strategy.

Cocoa

When Apple acquired NeXT Software (as it was then called) in 1997 ,OpenStep became the Yellow Box andwas included with Mac OS X Server (also known as Rhapsody) and Windows. Then, with the evolution of theMac OS X strategy, it was finally renamed to “Cocoa.”

Cocoa Framework

框架的组成,包括基础和应用

■ Mac OS X: Foundation and Application Kit

■iOS: Foundation and UIKit

Foundation

The Foundation framework defines a base layer of classes that can be used for any type of Cocoa program.The criterion separating the classes in Foundation from those in the Application Kit is the user interface.

Application Kit (Mac OS X)

The Application Kit (which is sometimes referred to as the AppKit) is a framework containing all the objectsyou need to implement your graphical, event-driven user interface on Mac OS X: windows, dialogs, buttons,menus, scrollers, text fields—the list goes on.

UIKit (iOS)

The UIKit framework on iOS is the sister framework of the Application Kit onMac OS X. Its purpose is essentiallythe same: to provide all the classes that an application needs to construct and manage its user interface.However, there are significant differences in how the frameworks realize this purpose.

Core Data

Core Data is a Cocoa framework that provides an infrastructure formanaging object graphs, including supportfor persistent storage to a variety of file formats. Object-graph management includes features such as undoand redo, validation, and ensuring the integrity of object relationships. Object persistence means that CoreData saves model objects to a persistent store and fetches them when required. The persistent store of aCore Data application—that is, the ultimate form in which object data is archived—can range from XML filesto SQL databases. Core Data is ideally suited for applications that act as front ends for relational databases,but any Cocoa application can take advantage of its capabilities.

Other Frameworks With Cocoa API

除了以上的基础框架以外,还有各种基于Cocoa的其他框架,如:

Sync Services—(Mac OS X only)

Address Book

Preference Panes—(Mac OS X only)

Screen Saver—(Mac OS X only)

iAd—(iOS only)

Map Kit—(iOS only)

知道了这些基本概念后,可以熟悉一下“Cocoa Fundamentals Guide”文档

然后参考一些相关的文档和例子就可以熟悉整个的框架情况

Cocoa Fundamentals Guide

■ Cocoa Fundamentals Guide

introduces the basic concepts, terminology, architectures, and design patternsof the Cocoa frameworks and development environment.

http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaFundamentals.pdf

这个官方文档包含了很多信息

特别4,5章描述了Cocoa中使用到的设计模式和对象之间的通讯形式,非常重要,否则使用这些类时,如果对设计模式等不熟悉的话,估计会一头雾水

相关文章
|
1月前
|
API 数据安全/隐私保护 iOS开发
利用uni-app 开发的iOS app 发布到App Store全流程
利用uni-app 开发的iOS app 发布到App Store全流程
85 3
|
3月前
|
存储 iOS开发
iOS 开发,如何进行应用的本地化(Localization)?
iOS 开发,如何进行应用的本地化(Localization)?
122 2
|
3月前
|
存储 数据建模 数据库
IOS开发数据存储:什么是 UserDefaults?有哪些替代方案?
IOS开发数据存储:什么是 UserDefaults?有哪些替代方案?
39 0
|
3月前
|
安全 编译器 Swift
IOS开发基础知识: 对比 Swift 和 Objective-C 的优缺点。
IOS开发基础知识: 对比 Swift 和 Objective-C 的优缺点。
91 2
|
3月前
|
API 开发工具 iOS开发
iOS 开发高效率工具包:10 大必备工具
iOS 开发高效率工具包:10 大必备工具
47 1
|
3月前
|
API 数据安全/隐私保护 iOS开发
利用uni-app 开发的iOS app 发布到App Store全流程
利用uni-app 开发的iOS app 发布到App Store全流程
54 1
|
6天前
|
API 定位技术 iOS开发
IOS开发基础知识:什么是 Cocoa Touch?它在 iOS 开发中的作用是什么?
【4月更文挑战第18天】**Cocoa Touch** 是iOS和Mac OS X应用的核心框架,包含面向对象库、运行时系统和触摸优化工具。它提供Mac验证的开发模式,强调触控接口和性能,涵盖3D图形、音频、网络及设备访问API,如相机和GPS。是构建高效iOS应用的基础,对开发者至关重要。
11 0
|
21天前
|
开发工具 Swift iOS开发
利用SwiftUI构建动态用户界面:iOS开发新范式
【4月更文挑战第3天】 随着苹果不断推进其软件开发工具的边界,SwiftUI作为一种新兴的编程框架,已经逐渐成为iOS开发者的新宠。不同于传统的UIKit,SwiftUI通过声明式语法和强大的功能组合,为创建动态且响应式的用户界面提供了一种更加简洁高效的方式。本文将深入探讨如何利用SwiftUI技术构建具有高度自定义能力和响应性的用户界面,并展示其在现代iOS应用开发中的优势和潜力。
|
1月前
|
iOS开发
iOS自动混淆测试处理笔记
iOS自动混淆测试处理笔记
12 0
|
2月前
|
监控 API Swift
用Swift开发iOS平台上的上网行为管理监控软件
在当今数字化时代,随着智能手机的普及,人们对于网络的依赖日益增加。然而,对于一些特定场景,如家庭、学校或者企业,对于iOS设备上的网络行为进行管理和监控显得尤为重要。为了满足这一需求,我们可以利用Swift语言开发一款iOS平台上的上网行为管理监控软件。
196 2