Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this

Table Of Contents

Organization of This Document
See Also
The Cocoa Environment
Introducing Cocoa
What Is Cocoa?
How Cocoa Fits into Mac OS X
Figure 1-1 Mac OS X architecture simplified perspective
Figure 1-2 Cocoa in the architecture of Mac OS X
How Cocoa Fits into iOS
Figure 1-4 Cocoa in the architecture of iOS
Features of a Cocoa Application
The Development Environment
Platform SDKs
Overview of Development Workflows
Figure 1-5 The TextEdit example project in Xcode
Interface Builder
Figure 1-6 The TextEdit Document Properties window in Interface Builder
Figure 1-7 The Interface Builder connections panel
The iOS Simulator
Performance Applications and Tools
AppleScript Studio (Mac OS X)
The Cocoa Frameworks
Foundation Paradigms and Policies
Figure 1-9 The Foundation class hierarchy
Application Kit (Mac OS X)
UIKit (iOS)
Comparing Application Kit and UIKit Classes
Figure 1-12 UIKit classes and their Application Kit counterparts
Table 1-1 Major classes of the Application Kit and UIKit
Core Data
Figure 1-13 Managed object contexts and the persistence stack
Other Frameworks With Cocoa API
A Bit of History
Figure 1-14 Application Kit class hierarchy in 1988
A Simple Cocoa Command-Line Tool
Listing 2-2 Cocoa code for a uniquing and sorting tool
Cocoa Objects
Object-Oriented Programming With Objective-C
The Objective-C Advantage
The Dynamism of Objective-C
Extensions to the Objective-C Language
Using Objective-C
Table 2-1 Important Objective-C defined types and literals
The Root Class
Root Class and Protocol
Overview of Root-Class Methods
Interface Conventions
Instance and Class Methods
Object Retention and Disposal
How Garbage Collection Works
How Memory Management Works
Figure 2-4 The life cycle of an object simplified view
Object Creation
Allocating an Object
Initializing an Object
Figure 2-8 Initialization up the inheritance chain
Figure 2-9 Interactions of secondary and designated initializers
The dealloc and finalize Methods
Class Factory Methods
Listing 2-6 A factory method for a singleton instance
Evaluating Inheritance Relationships
Listing 2-7 Using the class and superclass methods
Method Implementation and Protocol Conformance
Object Comparison
Object Mutability
Why Mutable and Immutable Object Variants?
Programming With Mutable Objects
Listing 2-13 Returning an immutable copy of a mutable instance variable
Listing 2-14 Making a snapshot of a potentially mutable object
Class Clusters
Simple Concept, Complex Interface
Figure 2-10 A simple hierarchy for number classes
Figure 2-11 A more complete number class hierarchy
Simple Concept, Simple Interface
Figure 2-12 Class cluster architecture applied to number classes
Creating Instances
Class Clusters With Multiple Public Superclasses
Creating Subclasses Within a Class Cluster
Creating a Singleton Instance
Listing 2-15 Strict implementation of a singleton
Starting Up
What Happens in the main Function
Adding Behavior to a Cocoa Program
Figure 3-1 The main event loop (Mac OS X)
Listing 3-1 The main function in a Cocoa for Mac OS X application
Using a Cocoa Framework
Kinds of Framework Classes
Cocoa API Conventions
Inheriting From a Cocoa Class
When to Override a Method
Basic Subclass Design
The Form of a Subclass Definition
Figure 3-4 Where to put declarations in the interface file
Overriding Superclass Methods
Instance Variables
Entry and Exit Points
Initialize or Decode?
Storing and Accessing Properties
Implementing Accessor Methods
Listing 3-5 Implementing accessors for a scalar instance variable
Key-Value Mechanisms
Object Infrastructure
Error Handling
Resource Management and Other Efficiencies
Functions, Constants, and Other C Types
When the Class Is Public (Mac OS X)
Multithreaded Cocoa Programs
Multithreading and Multiprocessing Resources
Multithreading Guidelines for Cocoa Programs
Are the Cocoa Frameworks Thread Safe?
What Is a Design Pattern?
A Solution to a Problem in a Context
Cocoa Design Patterns
An Example: The Command Pattern
Figure 4-1 Structure diagram for the Command pattern
How Cocoa Adapts Design Patterns
Abstract Factory
Chain of Responsibility
Figure 4-3 Framework object sending a message to its delegate
View Controllers in UIKit
Key-Value Observing
Template Method
The Model-View-Controller Design Pattern
Roles and Relationships of MVC Objects
Controller Objects Tie the Model to the View
Types of Cocoa Controller Objects
MVC as a Compound Design Pattern
Figure 4-5 Traditional version of MVC as a compound pattern
Figure 4-6 Cocoa version of MVC as compound design pattern
Figure 4-7 Coordinating controller as the owner of a nib file
Design Guidelines for MVC Applications
Model-View-Controller in Cocoa (Mac OS X)
Object Modeling
Figure 4-8 Employee management application object diagram
Accessing Properties
Figure 4-13 Employees table view showing department name
Communication in Object-Oriented Programs
Communicating With Objects
Delegates and Data Sources
How Delegation Works
The Form of Delegation Messages
Listing 5-2 Sample delegation methods returning void
Delegation and the Cocoa Application Frameworks
Table 5-1 Application Kit classes with delegates
Data Sources
Implementing a Delegate for a Custom Class
The Target-Action Mechanism
The Target
The Action
Target-Action in the Application Kit
Figure 5-3 How the target–action mechanism works
Target-Action in UIKit
Bindings (Mac OS X)
How Bindings Work
How You Establish Bindings
Figure 5-5 Establishing a binding in Interface Builder
Figure 5-6 Posting and broadcasting a notification
When and How to Use Notifications
The Notification Object
Notification Centers
Notification Queues
Figure 5-7 A notification queue and notification center
The Main Event Loop
More About Event Dispatch
Window Management
Figure A-4 The application's window list
Handling Apple Events
The Windows of an Application
NSWindow and the Window Server
Window Buffering
Window Z-Order and Levels
Parts of a Window
Figure A-7 A window's frame view and content view
Window Coordinates
Windows and Drawing
The View Hierarchy
Figure A-12 Relationships among objects in a view hierarchy
View Geometry and Coordinates
Figure A-17 Relation between coordinate systems of view and superview
How Views Get Drawn
Table A-3 NSView display methods Immediate display of marked views
Figure A-18 Nested focused views and graphics state stack
Views and Printing
Views and Events
Responders and the Responder Chain
Figure A-19 NSResponder and its direct subclasses
Controls and Menus
Control and Cell Architecture
Figure A-21 A control coordinating the drawing of a cell
Rationale for the Control-Cell Architecture
Menu Characteristics and Architecture
Represented Objects
Listing A-1 Using a represented object
Nib Files and Other Application Resources
Object Archives
Nib Files
Loading Application Resources
Document Architecture
Other Cocoa Architectures on Mac OS X
Figure B-1 Ownership relationships among the document classes
Application Scriptability
Document Revision History
0 of .
Results for:
No results containing your search query
P. 1


Ratings: (0)|Views: 1,506 |Likes:
Published by Daniel Maccarrone

More info:

Published by: Daniel Maccarrone on Mar 02, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





You're Reading a Free Preview
Pages 5 to 39 are not shown in this preview.
You're Reading a Free Preview
Pages 44 to 114 are not shown in this preview.
You're Reading a Free Preview
Pages 119 to 192 are not shown in this preview.
You're Reading a Free Preview
Pages 197 to 206 are not shown in this preview.
You're Reading a Free Preview
Pages 211 to 238 are not shown in this preview.

Activity (5)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Adam Colombo liked this
Sergei Gnezdov liked this
klavdaki3823 liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->