Muutke küpsiste eelistusi

Cocoa Programming Developer's Handbook [Pehme köide]

  • Formaat: Paperback / softback, 936 pages, kõrgus x laius x paksus: 228x180x33 mm, kaal: 1270 g
  • Sari: Developer's Library
  • Ilmumisaeg: 07-Jan-2010
  • Kirjastus: Addison-Wesley Educational Publishers Inc
  • ISBN-10: 0321639634
  • ISBN-13: 9780321639639
  • Formaat: Paperback / softback, 936 pages, kõrgus x laius x paksus: 228x180x33 mm, kaal: 1270 g
  • Sari: Developer's Library
  • Ilmumisaeg: 07-Jan-2010
  • Kirjastus: Addison-Wesley Educational Publishers Inc
  • ISBN-10: 0321639634
  • ISBN-13: 9780321639639

The Cocoa programming environment—Apple’s powerful set of clean, object-oriented APIs—is increasingly becoming the basis of almost all contemporary Mac OS X development. With its long history of constant refinement and improvement, Cocoa has matured into a sophisticated programming environment that can make Mac OS X application development quick, efficient, and even fun.

Yet for all its refined elegance and ease of use, the staggering size of the Cocoa family of APIs and the vast magnitude of the official documentation can be intimidating to even seasoned programmers.

To help Mac OS X developers sort through and begin to put to practical use Cocoa’s vast array of tools and technologies, Cocoa Programming Developer’s Handbook provides a guided tour of the Cocoa APIs found on Mac OS X, thoroughly discussing—and showing in action—Cocoa’s core frameworks and other vital components, as well as calling attention to some of the more interesting but often overlooked parts of the APIs and tools.

This book provides expert insight into a wide range of key topics, from user interface design to network programming and performance tuning.

List of Figures
xvii
List of Tables
xxiii
Preface xxv
I Introducing Cocoa
1(76)
Cocoa and Mac OS X
3(14)
Understanding When to Use Cocoa
3(6)
Carbon
3(2)
Java
5(1)
Cocoa
5(2)
UNIX APIs
7(1)
Other Choices
8(1)
Understanding Cocoa's Role in Mac OS X
9(7)
Cocoa
9(2)
Quartz
11(2)
Core Foundation
13(1)
Darwin
14(1)
XNU
15(1)
Overview
16(1)
Cocoa Language Options
17(10)
Object Orientation
17(2)
Objective-C
19(5)
Objective-C Compiler Choices
20(2)
Differences from Java and C++
22(1)
Objective-C 2.0
23(1)
Ruby and Python
24(1)
Summary
25(2)
Using Apple's Developer Tools
27(50)
Obtaining Apple's Developer Tools
28(1)
Interface Builder
28(9)
Outlets and Actions
30(1)
Cocoa Bindings
31(3)
Drawing a Simple Application
34(3)
XCode
37(6)
Creating a Simple Project
37(2)
OpenStep Bundles
39(2)
Developer Examples
41(1)
Building Without XCode
42(1)
Objective-C
43(23)
Why Learn Objective-C?
44(1)
Additions to C
44(8)
Exceptions and Synchronization
52(3)
Introspection
55(3)
Objective-C in C
58(2)
Objective-C 2.0
60(3)
Blocks
63(3)
Objective-C++
66(1)
Cocoa Conventions
66(8)
Naming
66(4)
Memory Management
70(2)
Constructors and Initializers
72(2)
Summary
74(3)
II The Cocoa Frameworks
77(208)
Foundation: The Objective-C Standard Library
79(54)
General Concepts
79(6)
Mutability
80(1)
Class Clusters
80(5)
Core Foundation Types
85(1)
Basic Data Types
85(8)
Non-Object Types
86(1)
Strings
87(1)
Boxed Numbers and Values
88(2)
Data
90(1)
Caches and Discardable Data
90(1)
Dates and Time
91(2)
Collections
93(7)
Comparisons and Ordering
93(3)
Primitive Collections
96(1)
Arrays
97(1)
Dictionaries
98(1)
Sets
99(1)
Enumeration
100(11)
Enumerating with Higher-Order Messaging
101(3)
Enumerating with Blocks
104(1)
Supporting Fast Enumeration
105(6)
Property Lists
111(6)
Serialization
112(2)
User Defaults
114(3)
Interacting with the Filesystem
117(7)
Bundles
117(3)
Workspace and File Management
120(2)
Working with Paths
122(1)
File Access
123(1)
Notifications
124(8)
Requesting Notifications
125(1)
Sending Notifications
126(1)
Sending Asynchronous Notification
127(3)
Distributed Notifications
130(2)
Summary
132(1)
Application Concepts
133(26)
Run Loops
133(7)
Applications and Delegates
140(2)
The Responder Chain
142(5)
Event Delivery
142(4)
Targets and Actions
146(1)
Becoming First Responder
147(1)
Run Loops in Applications
147(4)
Delegates and Notifications
151(3)
The View Hierarchy
154(3)
Windows
154(1)
Views
155(1)
Cells
156(1)
Summary
157(2)
Creating Graphical User Interfaces
159(44)
Positioning Views
159(5)
Nested Views
164(5)
Clipped Views
164(1)
Scroll Views
165(1)
Tab Views
166(1)
Split Views
167(2)
Boxes
169(1)
Creating Views
169(15)
Buttons
170(2)
Text Views
172(1)
Data Views
172(9)
Menus
181(3)
Cocoa Bindings
184(18)
Key-Value Coding
185(5)
Key-Value Observing
190(3)
Exposing Bindings
193(1)
Generic Controllers
194(1)
Bindings and User Defaults
195(1)
Using Bindings in Interface Builder
196(6)
Summary
202(1)
Windows and Menus
203(42)
Understanding Windows
204(4)
Types of Windows
207(1)
Creating Windows
208(1)
Creating Window Objects
208(11)
Displaying Windows
210(2)
Hiding Windows
212(2)
Understanding Window Controllers
214(1)
Creating a Simple Window Factory
214(4)
Saving a Window's Position
218(1)
Panels
219(4)
Displaying Standard Palettes
220(3)
Sheets
223(6)
Creating Sheets
223(1)
Showing Standard Sheets
224(5)
Alert Dialogs
229(3)
Menus
232(11)
The Structure of a Menu
232(2)
Populating the Window Menu
234(1)
Dock Menus
235(1)
Validating Menu Items
236(1)
Context Menus
237(4)
Pop-Up Menus
241(2)
Summary
243(2)
Text in Cocoa
245(40)
Constructing and Deconstructing Strings
246(2)
Annotating Strings
248(2)
Localization
250(4)
Localization Macros
251(1)
Strings Files
252(1)
Localizing Format Strings
253(1)
Text Storage
254(1)
Understanding Fonts
255(6)
Converting Fonts
257(4)
Enumerating Fonts
261(1)
Displaying Text
261(14)
Primitive Drawing
261(3)
Layout Managers
264(4)
Attachments
268(1)
Text Views
269(1)
Text Cells
270(5)
Writing a Custom Text Container
275(4)
Using Multiple Text Views
279(4)
Summary
283(2)
III Cocoa Documents
285(66)
Creating Document-Driven Applications
287(42)
The Cocoa Document Model
288(5)
File Types
289(3)
Document Objects
292(1)
Creating the Application Skeleton
293(2)
Creating the Document
295(6)
Loading the Windows
295(2)
Building the Document Model
297(1)
Loading and Saving Documents
297(4)
Document Creation Events
301(1)
Extending the Outliner
301(11)
Defining a Native File Format
302(2)
Defining a Foreign File Format
304(3)
Supporting Loading and Saving
307(5)
Supporting Undo
312(6)
Registering Undo Operations
314(2)
Creating Undo Groups
316(1)
Performing Undo Operations
316(1)
The Undo User Interface
317(1)
Adding Undo to the Outliner
318(10)
Summary
328(1)
Core Data
329(22)
Introducing Data Modeling
330(1)
Understanding Managed Objects
331(1)
Attribute Types
332(2)
Creating a Data Model
334(9)
Choosing a Persistent Store
343(2)
In-Memory Stores
343(1)
XML Stores
343(1)
Binary Stores
344(1)
SQLite Stores
344(1)
Custom Stores
345(1)
Storing Metadata
345(2)
Automatic Undo
347(1)
Core Data, Spotlight, and Time Machine
348(1)
Summary
349(2)
IV Complex User Interfaces
351(80)
Working with Structured Data
353(42)
Data Sources and Delegates
354(1)
Tables
354(8)
Table View Drawing
355(1)
Using Sort Descriptors
356(2)
Customizing a Table View
358(4)
Outline Views
362(14)
Extending the Outliner
363(13)
Browsers
376(4)
Browser Delegates
376(1)
Creating a Browser
377(3)
Collection Views
380(4)
Displaying Files in a Collection View
381(3)
Customizing Views with New Cells
384(3)
Creating Master-Detail Views
387(6)
Inspectors as Detail Views
389(4)
Summary
393(2)
Dynamic Views
395(36)
Tabbed Views
395(1)
Inspecting the View Hierarchy
396(2)
Modifying the View Hierarchy
398(14)
Reparenting Views
399(4)
Rearranging Views
403(4)
Detachable Tabs
407(5)
Creating Dynamic Input Forms
412(14)
Creating a Form with a Matrix
413(5)
Creating a Form with a Custom View
418(4)
Creating a Form with a Rule Editor
422(4)
Full-Screen Applications
426(3)
Summary
429(2)
V Advanced Graphics
431(158)
Custom Views
433(60)
The Graphics Context
434(1)
Core Graphics
435(3)
AppKit Drawing
438(32)
Drawing Shapes
439(4)
Drawing with Cells
443(10)
Drawing Text
453(4)
Creating New Cells
457(6)
Drawing Bitmap Images
463(5)
Compositing Images
468(2)
Printing and Paginating Views
470(12)
Print Info
471(1)
Creating Print Operations
472(3)
Paginating a View
475(6)
Automatic Pagination
481(1)
Extending Interface Builder with Palettes
482(9)
Summary
491(2)
Sound and Video
493(28)
Beeping
493(1)
Playing Simple Sounds
494(4)
Understanding Cocoa Movie Objects
498(4)
Adding Video
502(4)
Editing Media
506(1)
Low-Level Sound APIs
507(1)
Sound and Video Recording
508(4)
Supporting Speech
512(1)
Cocoa Speech Synthesis
513(1)
Conversing with Users
514(5)
Summary
519(2)
Advanced Visual Effects
521(34)
Simple Animation
521(2)
Core Animation Overview
523(5)
Drawing in a Layer
524(4)
Setting a Layer's Content
528(1)
Understanding Animation Concepts
528(3)
Adding Simple Animations
531(2)
Image Filters
533(7)
Defining Transitions
540(3)
Creating Complex Animations
543(1)
3D Core Animation Transforms
544(5)
OpenGL and Cocoa Views
549(3)
Quartz Composer
552(1)
Summary
553(2)
Supporting PDF and HTML
555(34)
HTML in AppKit
556(1)
Advanced HTML Support
557(8)
WebKit Overview
559(2)
Web View Delegates
561(1)
Editing HTML
562(3)
Dynamic Interfaces with WebKit
565(7)
PDF and Quartz
572(2)
Displaying PDFs
574(14)
Understanding PDF Annotations
578(3)
Setting Document Metadata
581(2)
Editing PDFs
583(5)
Summary
588(1)
VI User Interface Integration
589(162)
Searching and Filtering
591(46)
Maintaining Document Indexes
592(5)
Creating an Index
592(2)
Indexing Documents
594(1)
Searching an Index
595(2)
Displaying Search Boxes
597(2)
Searching for Documents
599(11)
Spotlight
610(13)
Monitoring Filesystem Events
611(1)
Metadata Indexing
611(2)
Building a Metadata Import Plugin
613(6)
Searching with Spotlight
619(3)
Spotlight Limitations
622(1)
Predicates
623(9)
The Predicate Language
623(2)
Creating Predicates Directly
625(2)
Using Predicates
627(1)
Displaying a Predicate Editor
628(4)
Quick Look
632(4)
Previewing Bundles
633(1)
Implementing Quick Look Plugins
634(2)
Summary
636(1)
Contacts, Calendars, and Secrets
637(38)
Address Book Overview
637(5)
General Concepts
638(1)
Collection Classes
639(3)
Getting Information About People
642(1)
Searching the Address Book
643(2)
Populating the ``Me'' vCard
645(3)
Adding People to the Address Book
648(1)
Storing Secrets
649(10)
Calendars
659(7)
Calendar Store Concepts
659(2)
Accessing Events
661(4)
Creating Calendars
665(1)
Synchronizing Data
666(7)
Using Apple Schemas
667(6)
Summary
673(2)
Pasteboards
675(32)
Pasteboard Overview
675(2)
Pasteboard Types
677(3)
Filtered Types
680(1)
Property List Data
681(1)
Self-Encoding Objects
682(1)
Files and Pasteboards
683(1)
Copy and Paste
684(2)
Drag and Drop
686(11)
Drag Operations
687(2)
Drop Operations
689(1)
Implementing Drag and Drop in a Custom View
690(7)
Drag and Drop with Data Views
697(8)
Summary
705(2)
Services
707(14)
Example Services
707(2)
An Evaluate Service
709(5)
Using Services
714(3)
Controlling the Services Menu
717(1)
Filter Services
718(1)
Summary
719(2)
Adding Scripting
721(30)
Scripting Overview
721(4)
The AppleScript Object Model
723(1)
Scripting Vocabulary
723(2)
Making Objects Scriptable
725(15)
Understanding AppleScript Objects
725(1)
Providing Object Specifiers
726(2)
Providing a Scripting Definition
728(5)
Handling Scripting Commands
733(4)
Testing Scripting Support
737(3)
Scripting from Cocoa
740(7)
Exposing Services to Automator
747(1)
Other Scripting Technologies
748(2)
Distributed Objects
748(1)
F-Script
749(1)
Summary
750(1)
VII System Programming
751(72)
Networking
753(34)
Low-Level Socket Programming
753(6)
Cocoa Streams
759(1)
URL Handling
760(8)
Creating URLs
761(1)
Loading URLs
762(2)
Extending the URL Loading System
764(4)
Bonjour
768(5)
Multicast DNS
768(1)
DNS Service Discovery
768(1)
Browsing Services
769(3)
Advertising Services
772(1)
Distributed Objects
773(12)
Publishing Objects
774(2)
Getting Remote Objects
776(1)
A Simple Chat Program
777(8)
Summary
785(2)
Concurrency
787(36)
Distributed Objects
788(1)
Threading
789(18)
Creating Threads
790(1)
Thread-Local Storage
790(1)
Synchronization
791(8)
Atomic Operations
799(4)
Futures and Forwarding
803(3)
Stress Testing Threads
806(1)
Child Processes
807(6)
Creating Child Processes
807(1)
Communicating with Children
807(2)
Sharing Memory
809(4)
Operation Queues
813(6)
Grand Central Dispatch
819(2)
OpenCL
821(1)
Summary
822(1)
VIII Appendixes
823(62)
Portable Cocoa
825(12)
NeXT and Sun
825(1)
Mobile OS X on the iPhone
826(1)
OpenStep and GNU
826(1)
GNUstep
827(6)
GORM
829(1)
Building with GNUstep
830(2)
Etoile
832(1)
QuantumSTEP
833(1)
Cocotron
834(1)
GNUstepWeb and SOPE
834(3)
Advanced Tricks
837(48)
The Preprocessor
838(5)
Initializers
838(1)
For Each
838(2)
Objective-C Constants
840(1)
Simple Templates
841(1)
Friendly Debug Output
842(1)
Control Structures
843(8)
NSDictionary Abuse
843(1)
Key-Value Coding
844(2)
Trampolines
846(3)
State Machines
849(2)
Clean Code
851(4)
Toll-Free Bridging
851(2)
Multiple Inheritance
853(2)
Optimization
855(14)
Instance Method Pointers
855(2)
Subverting Dynamic Dispatch
857(2)
Objects on the Stack
859(5)
Object Pools
864(1)
Inline Functions
865(2)
Avoid Objects
867(2)
Cross-Platform Cocoa
869(3)
The Runtime System
872(13)
Understanding Object Implementation
873(3)
Enumerating All Subclasses
876(3)
Adding Methods to a Class
879(6)
Index 885
David Chisnall has in-depth knowledge of Cocoa as both an implementer and a developer. He is an active contributor to the GNUstep project, which provides an open source implementation of the Cocoa APIs, and cofounded the Étoilé project to build a desktop environment atop GNUstep. He has created a new Objective-C runtime library, worked on Objective-C support in the clang compiler, and published papers on Objective-C. He wrote a popular series of articles on Objective-C and Cocoa for informIT.com and is the author of The Definitive Guide to the Xen Hypervisor (Addison-Wesley, 2008).