Cocoa编程指南:Mac OS X版

需积分: 10 2 下载量 57 浏览量 更新于2024-07-28 收藏 9.93MB PDF 举报
“CocoaProgrammingForMacOsX3rd(HD).pdf”是一个关于Mac OS X平台上的Cocoa编程的教程,适用于iPhone和iOS开发。这个教程由appleboy翻译,jinifly制作成PDF,共有35章,但提供的版本只包含前17章。 在教程中,作者首先介绍了Cocoa的基础概念,包括什么是Cocoa。Cocoa是Apple的框架集合,用于构建Mac OS X和iOS应用程序,它包含了Objective-C语言、Foundation框架和AppKit或UIKit等组件。 第二章深入讲解了XCode和InterfaceBuilder这两个重要的开发工具。XCode是Apple的官方集成开发环境(IDE),用于编写Objective-C代码和构建应用。InterfaceBuilder则是一个可视化设计工具,用于设计应用程序的用户界面。 接下来,教程详细介绍了Objective-C语言,这是Cocoa的基础。讲解了如何创建和使用对象,利用已有类,创建自定义类以及如何使用调试器进行问题排查。 第四章聚焦于内存管理,讨论了垃圾收集器(Garbage Collector)的启用和使用,以及在没有垃圾收集器的情况下如何使用引用计数(Retain Count)来管理内存。 第五章讲解了Target/Action模式,这是Cocoa中事件处理的核心机制。通过介绍一些常用的NSControl子类和一个SpeakLine的例子,读者可以学习如何响应用户交互并布局界面。 第六章介绍了辅助对象,如代理(Delegates)和数据源(DataSource)。代理在对象间传递信息和执行操作,而数据源负责向视图(如NSTableView)提供数据。这一章还讲解了如何布局用户界面,建立连接,并编辑代码以实现这些功能。 第七章涵盖Key-Value Coding (KVC) 和 Key-Value Observing (KVO)。KVC是一种非侵入式的属性访问机制,而KVO则允许对象监听其他对象的属性变化。教程中详细阐述了如何使用这两种技术,以及它们在实际开发中的应用。 最后,第八章涉及NSArrayController,这是一个用于管理数组数据并自动更新与之绑定的用户界面的控制器。通过一个名为RaiseMan的程序实例,读者将学习如何使用NSArrayController来构建数据驱动的应用。 这个教程覆盖了Cocoa编程的关键方面,包括基础概念、开发工具、Objective-C语言、内存管理、事件处理、数据绑定以及数据模型的管理,对于想要学习Mac OS X或iOS开发的初学者来说是非常有价值的资源。
2008-07-16 上传

http://img.verycd.com/posts/0805/post-320613-1211456113.jpg

书名:Cocoa® Programming for Mac® OS X, Third Edition
作者:Aaron Hillegass
出版商:Addison Wesley Professional
出版日期:2008年5月
文件格式:CHM

Overview
The best-selling introduction to Cocoa, once again updated to cover the latest Mac programming technologies, and still enthusiastically recommended by experienced Mac OS X developers.

"Aaron's book is the gold standard for Mac OS X programming books–beautifully written, and thoughtfully sculpted. The best book on Leopard development."

–Scott Stevenson, www.theocacao.com

"This is the first book I'd recommend for anyone wanting to learn Cocoa from scratch. Aaron's one of the few (perhaps only) full-time professional Cocoa instructors, and his teaching experience shows in the book."

–Tim Burks, software developer and creator of the Nu programming language, www.programming.nu

"If you're a UNIX or Windows developer who picked up a Mac OS X machine recently in hopes of developing new apps or porting your apps to Mac users, this book should be strongly considered as one of your essential reference and training tomes."

–Kevin H. Spencer, Apple Certified Technical Coordinator

If you're developing applications for Mac OS X, Cocoa® Programming for Mac® OS X, Third Edition, is the book you've been waiting to get your hands on. If you're new to the Mac environment, it's probably the book you've been told to read first. Covering the bulk of what you need to know to develop full-featured applications for OS X, written in an engaging tutorial style, and thoroughly class-tested to assure clarity and accuracy, it is an invaluable resource for any Mac programmer.

Specifically, Aaron Hillegass introduces the three most commonly used Mac developer tools: Xcode, Interface Builder, and Instruments. He also covers the Objective-C language and the major design patterns of Cocoa. Aaron illustrates his explanations with exemplary code, written in the idioms of the Cocoa community, to show you how Mac programs should be written. After reading this book, you will know enough to understand and utilize Apple's online documentation for your own unique needs. And you will know enough to write your own stylish code.

Updated for Mac OS X 10.4 and 10.5, this revised edition includes coverage of Xcode 3, Objective-C 2, Core Data, the garbage collector, and CoreAnimation.