You are previewing Xcode® 4 Unleashed, Second Edition.
O'Reilly logo
Xcode® 4 Unleashed, Second Edition

Book Description

In Xcode 4 Unleashed, renowned Mac/iOS developer Fritz Anderson shows how to use Apple’s powerful new Xcode 4 integrated development environment to develop outstanding software with the least effort possible.

Anderson demonstrates Xcode 4 by walking through the construction of three full applications: a command-line tool, an iOS app, and a Mac OS X application. These case-study projects offer practical insights and realistic best practices for efficiently utilizing Xcode 4 in day-to-day development.

Next, he drills down to offer an even deeper understanding of Xcode 4’s most powerful capabilities. Through practical examples, he shows experienced Apple developers how to move to Xcode 4’s “browser” model from older document-based approaches. You’ll also find thorough, up-to-the-minute coverage of key tasks ranging from builds and profiling to documentation.

He concludes with a chapter-length roundup of “tips, traps, and features” for maximizing your productivity with Xcode 4—whether you’re writing iOS apps or Mac applications, working solo, or as part of a large development team.

Detailed information on how to…

  • Get started fast with Xcode 4 project workflow

  • Master Xcode 4’s new features and development paradigms

  • Construct modern iOS and Mac user interfaces with Interface Builder

  • Implement Model-View-Controller designs in iOS apps

  • Use Storyboard to specify an iOS app’s entire structure in one file

  • Leverage Xcode’s first-class unit testing and measurement tools

  • Master the essentials of iOS provisioning

  • Use Mac OS X bindings to simplify the link between data and screen

  • Quickly localize Mac and iOS software for new languages and markets

  • Package and share subprograms that can be integrated into any OS X application

  • Use the Xcode Build System to move from source files to executable products

  • Fully understand and optimize performance and resource usage

  • Register your copy today at informit.com/register to download a free 90+page guide to 4.4 & 4.5 feature changes

    Table of Contents

    1. Title Page
    2. Copyright Page
    3. Praise for Xcode 4 Unleashed
    4. Praise for Xcode 3 Unleashed
    5. Contents at a Glance
    6. Table of Contents
    7. About the Author
    8. Dedication
    9. Acknowledgments
    10. We Want to Hear from You!
    11. Reader Services
    12. Introduction
      1. How This Book Is Organized
      2. About Versions
      3. Conventions
    13. Part I. First Steps
      1. Chapter 1. Getting Xcode
        1. Before You Do Anything
        2. Requirements
        3. Installing Xcode
        4. What You Get
        5. Removing Xcode
        6. Apple Developer Programs
        7. Through an Installer Package
        8. Summary
      2. Chapter 2. Kicking the Tires
        1. Starting Xcode
        2. Hello World
        3. The Real Thing
        4. Getting Rid of It
        5. Summary
      3. Chapter 3. Simple Workflow and Passive Debugging
        1. Building
        2. Running
        3. Simple Debugging
        4. Summary
      4. Chapter 4. Active Debugging
        1. A Simple Test Case
        2. Going Active
        3. Fixing the Problem
        4. Summary
      5. Chapter 5. Compilation
        1. Compiling
        2. Linking
        3. Dynamic Loading
        4. Xcode’s Refinements
        5. Compiler Products
        6. Summary
      6. Chapter 6. Adding a Library Target
        1. Adding a Target
        2. Targets
        3. Target Membership
        4. A Dependent Target
        5. Adding a Library
        6. Debugging a Dependent Target
        7. Summary
      7. Chapter 7. Version Control
        1. Taking Control
        2. The State of Your Files
        3. Your First Commit
        4. Adding a Remote Repository
        5. Starting from a Repository
        6. Merges and Conflicts
        7. The Versions View
        8. Summary
    14. Part II. The Life Cycle of an iOS Application
      1. Chapter 8. Starting an iOS Application
        1. Planning the App
        2. Starting a New iPhone Project
        3. One More Thing
        4. Summary
      2. Chapter 9. An iOS Application: Model
        1. Implementing the Model
        2. Managed-Object Classes
        3. Making the Model Easier to Debug
        4. Summary
      3. Chapter 10. An iOS Controller
        1. Renaming Symbols
        2. Editing the View Controller
        3. Live Issues and Fix-it
        4. The Real Passer Rating
        5. Summary
      4. Chapter 11. Building a New View
        1. Adding a View Controller
        2. Building a View
        3. Code Completion and Snippets
        4. Testing the Passer Detail View
        5. Summary
      5. Chapter 12. Adding Table Cells
        1. The Game Table
        2. Schemes
        3. A Custom Table Cell
        4. Summary
      6. Chapter 13. Unit Testing
        1. Logic Testing
        2. Application Testing
        3. SenTestingKit Assertions
        4. Summary
      7. Chapter 14. Measurement and Analysis
        1. Speed
        2. Memory
        3. Analysis
        4. Summary
      8. Chapter 15. Storyboard
        1. What Storyboard Is
        2. A Storyboard Project
        3. Reconstructing Passer Rating
        4. A Custom Table View Cell
        5. Adding a Passer Editor
        6. Summary
      9. Chapter 16. Provisioning
        1. Developer Programs
        2. The Provisioning Story
        3. The Provisioning Portal
        4. Using a Signing Identity
        5. Distribution Builds
        6. Sharing Identities and Profiles
        7. Preparing an App Store Release
        8. Summary
    15. Part III. Xcode for Mac OS X
      1. Chapter 17. Starting a Mac OS X Application
        1. The Goal
        2. Getting Started
        3. Model
        4. Making the Application Twitch
        5. Summary
      2. Chapter 18. Wiring a Mac Application with Bindings
        1. Filling the Document Window
        2. Your First Object Controller
        3. The Passer and Game Array Controllers
        4. The Game Popover
        5. Summary
      3. Chapter 19. A Custom View for Mac OS X
        1. A Graphing View
        2. Back to the View Controller
        3. Custom View Properties
        4. Summary
      4. Chapter 20. Localization and Autolayout
        1. Adding a Localization
        2. Localizing the Window XIBs
        3. Localizing Info.plist
        4. Strings in Code
        5. Summary
      5. Chapter 21. Bundles and Packages
        1. A Simple Package: RTFD
        2. Bundles
        3. Application Bundles
        4. The Info.plist File
        5. Info.plist Keys
        6. Summary
      6. Chapter 22. Frameworks
        1. Adding a Framework Target
        2. Installing a Framework
        3. Building Mac Passer Rating
        4. Summary
      7. Chapter 23. Property Lists
        1. Property List Types
        2. Editing Property Lists
        3. Other Formats
        4. Specialized Property Lists
        5. Summary
    16. Part IV. Xcode Tasks
      1. Chapter 24. Xcode 4 for Xcode 3 Veterans
        1. The Desktop and the Browser
        2. The Editor
        3. Building
        4. Where Did Everything Go?
        5. Interface Builder
        6. Other Changes
        7. Summary
      2. Chapter 25. Documentation in Xcode
        1. Intrinsic Help
        2. The Documentation Organizer
        3. Keeping Current
        4. Generating Documentation
        5. Summary
      3. Chapter 26. The Xcode Build System
        1. Xcode Build Variables
        2. Settings Hierarchy
        3. Configurations
        4. Configuration Files
        5. The xcodebuild Tool
        6. Custom Build Rules
        7. The Build Log
        8. A Simple Build Transcript
        9. Summary
      4. Chapter 27. Instruments
        1. What Instruments Is
        2. Running Instruments
        3. The Instruments
        4. Custom Instruments
        5. The Templates
        6. Summary
      5. Chapter 28. Snippets
        1. Tricks
        2. Traps
    17. Part V. Appendixes
      1. Appendix A. Objective-C
        1. The Basics
        2. A Class Interface
        3. A Class Implementation
        4. Objective-C 2.0 and Cocoa
        5. Fast Enumeration
        6. Foundation Data Types
        7. Dynamic Dispatch
        8. Objective-C++
        9. Summary
      2. Appendix B. Some Build Variables
        1. Useful Build Variables
        2. Source Trees
      3. Appendix C. Project and Target Templates
        1. iOS Project Templates
        2. Mac OS X Project Templates
        3. Target Templates
        4. iOS File Templates
        5. Mac OS X File Templates
        6. The File Template Library
        7. Summary
      4. Appendix D. Resources
        1. Books
        2. On the Net
        3. Face-to-Face
        4. Other Software
    18. Index