You are previewing Cocoa® Programming.
O'Reilly logo
Cocoa® Programming

Book Description

Cocoa Programming is a comprehensive work that starts as a fast-paced introduction to the OS architecture and the Cocoa language for programmers new to the environment. The more advanced sections of the book will show the reader how to create Cocoa applications using Objective-C, to modify the views, integrate multimedia, and access networks. The final sections explain how to extend system applications and development tools in order to create your own frameworks.

Table of Contents

  1. Copyright
  2. About the Authors
  3. Acknowledgments
  4. We Want to Hear From You!
  5. Reader Services
  6. Introduction
  7. Overview
    1. Cocoa and Mac OS X
      1. Understanding When to Use Cocoa
      2. Understanding Cocoa’s Role in Mac OS X
      3. What You Need to Use Cocoa
      4. What’s Included in Cocoa
      5. Summary
    2. Cocoa Language Options
      1. Object Orientation
      2. Java
      3. Objective-C
      4. Other Languages
      5. Choosing a Language for Use with Cocoa
      6. The Use of Objective-C in This Book
      7. Summary
    3. Using Apple’s Developer Tools
      1. Obtaining Apple’s Developer Tools
      2. Project Builder
      3. Interface Builder
      4. Frameworks
      5. Samples
      6. Terminal
      7. Other Tools
      8. Summary
    4. Objective-C
      1. Why Learn Objective-C?
      2. Additions to C
      3. Apple’s Extensions
      4. The NSObject Base Class
      5. Runtime Functions
      6. Objective-C++
      7. Summary
    5. Cocoa Conventions
      1. Naming
      2. Initializers
      3. Managing Memory
      4. Accessors
      5. Using Memory Zones
      6. Encoding and Decoding
      7. Summary
    6. Cocoa Design Patterns
      1. Understanding Design Patterns
      2. A Catalog of Cocoa Design Patterns
      3. Summary
  8. The Cocoa Frameworks
    1. Foundation Framework Overview
      1. Mutability
      2. Class Clusters
      3. Typed Storage
      4. Collections
      5. Property Lists
      6. Run Loops and Timers
      7. Support Types
      8. String Processing
      9. Bundles
      10. File System Access
      11. Defaults System
      12. Notifications
      13. Related Core Foundation
      14. Summary
    2. The Application Kit Framework Overview
      1. Events and the Run Loop
      2. Responders
      3. NSApplication Overview
      4. NSWindow Overview
      5. NSView Overview
      6. Delegates
      7. Target-Action Paradigm
      8. Archived Objects and Nibs
      9. NSWindowController Overview
      10. Multidocument Applications
      11. Undo and Redo
      12. Menu Validation
      13. Spell Checking
      14. Summary
    3. Applications, Windows, and Screens
      1. The New Image Viewer
      2. Working with NSWindow
      3. Working with NSApplication
      4. Modal Loops
      5. Working with Sheets
      6. Working with Drawers
      7. Working with Screens
      8. Working with Panels
      9. Summary
    4. Views and Controls
      1. Controls
      2. Simple Views and Controls
      3. Container Views and Controls
      4. Compound Controls
      5. Summary
    5. The Cocoa Text System
      1. Using the High-Level Text Classes
      2. The Text System Architecture
      3. Managing Fonts
      4. Text Input
      5. Summary
    6. Custom Views and Graphics Part I
      1. The Quartz Graphics Model
      2. Quartz Graphics Via the Application Kit
      3. Using the NSBezierPath Class
      4. Modifying Drawing
      5. Summary
    7. Custom Views and Graphics Part II
      1. Using NSGraphicsContext
      2. Coordinate System Transformations
      3. Drawing Points and Rectangles
      4. Optimizing Drawing
      5. Summary
    8. Custom Views and Graphics Part III
      1. Images and Bitmaps
      2. Drawing Text
      3. Summary
    9. Events and Cursors
      1. Event Handling in Custom NSView Subclasses
      2. Managing Cursors
      3. Summary
    10. Menus
      1. Standard Menu Layouts
      2. NSMenu Class
      3. NSMenuItem Class
      4. Menu Validation
      5. Contextual Menus
      6. Dock Menus
      7. Deprecated Functionality
      8. Summary
    11. Color
      1. NSColor Class
      2. Color Wells
      3. Color Panels
      4. Customizing the Color Panel
      5. NSColorList Class
      6. Summary
    12. Advanced Views and Controls
      1. NSTableView, NSOutlineView, and NSBrowser Concepts
      2. Table Views
      3. Outline Views
      4. Browsers
      5. Combo Boxes
      6. Custom Controls
      7. Toolbars
      8. Status Bars
      9. NSQuickDrawView Class
      10. Summary
    13. Using Pasteboards
      1. Pasteboard Concepts
      2. Implementing Cut, Copy, and Paste
      3. Implementing Drag and Drop
      4. Implementing Services
      5. Summary
    14. Adding Online Help
      1. Apple Help
      2. ToolTips
      3. Context-Sensitive Help (NSHelpManager)
      4. Summary
    15. Multimedia
      1. Sound
      2. QuickTime
      3. 3D Graphics
      4. Summary
    16. Integrating with the Operating System
      1. Getting System Information
      2. Authentication and Security
      3. Communicating with the Workspace
      4. Summary
    17. Networking
      1. NSURL and NSURLHandle
      2. Email Messages
      3. Directory Services
      4. Interapplication Programming
      5. Summary
    18. Subprocesses and Threads
      1. Choosing Between Subprocesses and Threads
      2. Using the NSTask Class
      3. Using the NSThread Class
      4. Locking
      5. Threading Issues
      6. Summary
    19. Printing
      1. Basic Printing
      2. Overview of the Printing Classes
      3. NSView’s Printing Support
      4. Printing and Pagination Example
      5. Printing in NSDocument-Based Applications
      6. Summary
  9. Cocoa Techniques
    1. Application Requirements, Design, and Documentation
      1. Designing an Application with Requirements
      2. Designing TransparentTetris
      3. Implementing the Design
      4. Using AutoDoc
      5. Summary
    2. Creating Custom Frameworks
      1. Creating and Using a Framework
      2. Header Files
      3. Providing Backward Compatibility
      4. Debugging Frameworks
      5. Summary
    3. Distributing Applications
      1. Package Directories
      2. Using Disk Images
      3. Application Installation
      4. Summary
  10. Appendixes
    1. Unleashing the Objective-C Runtime
      1. Objective-C Objects
      2. Messaging with IMPs and Selectors
      3. Common Runtime Functions
      4. Forwarding, Distributed Objects, and Proxies
      5. Examples
      6. Summary
    2. Optimizing and Finding Memory Leaks
      1. Optimizing Applications
      2. Finding Memory Leaks
      3. Summary
    3. Finding Third-Party Resources
      1. Apple-Provided Documentation
      2. Example Code
      3. Web Sites
      4. Mailing Lists
      5. Summary
    4. Cocoa Additions in Mac OS X Version 10.2
      1. Quartz Extreme
      2. Handwriting Recognition
      3. Address Book and vCard
      4. Universal Access
      5. Updated Tools
      6. Framework Enhancements
      7. Summary
  11. Index