You are previewing Beginning Mac OS® X Programming.
O'Reilly logo
Beginning Mac OS® X Programming

Book Description

Beginning Mac OS X Programming

Every Mac OS X system comes with all the essentials required for programming: free development tools, resources, and utilities. However, finding the place to begin may be challenging, especially if you have no prior development knowledge. This comprehensive guide offers you an ideal starting point to writing programs on Mac OS X, with coverage of the latest release - 1.4 "Tiger."

With its hands-on approach, the book examines a particular element and then presents step-by-step instructions that walk you through how to use that element when programming. You'll quickly learn how to efficiently start writing programs on Mac OS X using languages such as C, Objective-C(r), and AppleScript(r), technologies such as Carbon(r) and Cocoa(r), and other Unix tools. In addition, you'll discover techniques for incorporating the languages in order to create seamless applications. All the while, you can follow along on your own system so that you'll be prepared to apply your new Mac OS X skills to real-world projects.

What you will learn from this book

  • The major role the new Xcode plays in streamlining Mac OS X development

  • The process for designing a graphical user interface on Mac OS X that conforms to Apple's guidelines

  • How to write programs in the C and Objective-C programming languages

  • The various scripting languages available on the Mac OS X system and what tasks each one is best suited to perform

  • How to write shell scripts that interact with pre-installed command-line tools

  • Who this book is for

    This book is for novice programmers who want to get started writing programs that run on Mac OS X. Experienced programmers who are new to the Mac will also find this book to be a useful overview of the Mac development environment.

    Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved.

    Table of Contents

    1. Copyright
    2. About the Authors
    3. Credits
    4. Dedication
    5. Acknowledgments
    6. Introduction
    7. Mac OS X Developer Resources
      1. The Mac OS X Environment
        1. Introducing the Mac OS X
        2. The Core Operating System
        3. Graphics and Media Layers
        4. Application Frameworks and UI
        5. Apple Human Interface Guidelines
        6. Summary
        7. Exercises
      2. Developer Tools
        1. Installing the Developer Software
        2. Developer Applications
        3. Developer Documentation and Examples
        4. Apple Developer Connection
        5. Summary
        6. Exercises
      3. Xcode
        1. Starting a New Project
        2. Working with Files
        3. Writing Your Code
        4. Building and Running
        5. Using the Debugger
        6. Online Documentation
        7. Summary
        8. Exercises
      4. Interface Builder
        1. Starting a New Interface
        2. Building Menus
        3. Building Windows
        4. Making Windows Resizable
        5. Summary
        6. Exercises
    8. Application Programming
      1. The Application
        1. Basic Bundle Structure
        2. Examining Application Bundles
        3. Building an Application Bundle
        4. Application Preferences
        5. Summary
        6. Exercises
      2. The C Language
        1. A Little History
        2. Getting Started
        3. Variables and Data Types
        4. Operators
        5. Arrays and Pointers
        6. Conditional Branching
        7. Loops
        8. Functions
        9. Characters and Strings
        10. Input/Output
        11. Data Structures
        12. Memory Management
        13. The Preprocessor
        14. Organizing Programs
        15. Summary
        16. Exercises
      3. The Objective-C Language
        1. Object-Oriented Programming
        2. Classes and Objects
        3. Methods
        4. Data Hiding
        5. Subclassing
        6. Messaging
        7. Protocols and Informal Protocols
        8. Naming Conventions
        9. Creating and Destroying Objects
        10. Memory Management
        11. Accessor Methods
        12. Summary
        13. Exercises
      4. Using the Cocoa Frameworks
        1. Connecting Cocoa Interfaces
        2. Working with Documents
        3. Subclassing Controls in Interface Builder
        4. Connecting Menus
        5. Selecting Files with Open Panels
        6. Tracking Changes with Notifications
        7. Using Drawers
        8. Working with Table Views
        9. Handling Undo
        10. Archiving Objective-C Objects
        11. Application Preferences
        12. Responding to Keyboard Events
        13. Summary
        14. Exercises
      5. Using the Carbon Frameworks
        1. Memory Management in Carbon
        2. Connecting Carbon Interfaces
        3. Carbon File Manager
        4. Working with QuickTime
        5. Summary
        6. Exercises
    9. Script Programming
      1. Overview of Scripting Languages
        1. What Is a Script?
        2. What Is a Scripting Language?
        3. Bash
        4. AppleScript
        5. Python
        6. Perl
        7. JavaScript and Dashboard
        8. Other Scripting Languages
        9. Summary
        10. Exercises
      2. The Bash Shell
        1. Getting Started
        2. Unix Basics
        3. Shell Programming
        4. Summary
        5. Exercises
      3. AppleScript and AppleScript Studio
        1. AppleScript
        2. AppleScript Studio
        3. Summary
        4. Exercises
      4. Using Scripts Within Applications
        1. Running Subprocesses with C Functions
        2. Running Scripts with Cocoa
        3. Summary
        4. Exercise
    10. Exercise Answers
      1. Chapter 1
      2. Chapter 2
      3. Chapter 3
      4. Chapter 4
      5. Chapter 5
      6. Chapter 6
      7. Chapter 7
      8. Chapter 8
      9. Chapter 9
      10. Chapter 10
      11. Chapter 11
      12. Chapter 12
      13. Chapter 13
    11. Developer Resources
      1. Websites
      2. Mailing Lists
      3. Other Resources
    12. Developer Tools Roadmap
      1. Build Tools
      2. Graphics Tools
      3. Java Tools
      4. Performance Tools
      5. Other Utilities
      6. Command-Line Tools
    13. Index