Xcode 2.0 User Guide
(Legacy)
PDF
Introduction
Developing a Software Product With Xcode
Defining a Product
Creating a Project
Project Organization and Navigation
Organizing a Project
Project Navigation
Finding Information
Filtered Searching
Searching in a Project
Getting Information About Items in a Project
Using the Documentation
HeaderDoc
Editing Files
Resources and Localization
Information Property List Files
Strings Files
Nib Files
Resource Manager Files
The Edit/Build/Debug Cycle
Tools
Building
Debugging
Optimizing the Edit/Build/Debug Cycle
Analyzing and Optimizing Your Software
Customizing Your Work Environment
Preferences
Customizing the Xcode User Interface
Working in a Shell
Part I: Projects
Projects in Xcode
Components of an Xcode Project
The Project Directory
Creating a Project
Choosing a Project Template
Creating a New Project
Importing a Project
Importing CodeWarrior Projects
Before You Import
Importing Your CodeWarrior Project into Xcode
Converting a Project Builder Project
Importing Projects From ProjectBuilderWO
Opening and Closing Projects
The Project Window
The Project Window and its Components
The Groups & Files List
Groups in Xcode
Hiding and Showing Groups
Viewing the Contents of a Group
Splitting the Groups & Files View
The Detail View
The Information Displayed in the Detail View
Searching and Sorting in the Detail View
The Project Window Toolbar
The Project Window Status Bar
Project Window Layouts
The Default Layout
The Condensed Layout
The All-In-One Layout
The Project Page
The Build Page
Other Windows in the All-In-One Layout
Changing the Project Window Layout
Saving Changes to the Current Layout
Viewing Additional Information on Project Items and Operations
Inspector and Info Windows
Viewing the Progress of Operations in Xcode
Files in a Project
Files in Xcode
The Files in a Project
How Files Are Referenced
Adding Files, Frameworks, and Folders to a Project
Adding Files and Folders
Adding Frameworks
Removing Files
Source Trees
Referencing Other Projects
Organizing Xcode Projects
Software Organization Tips
Dividing Your Work Into Projects and Targets
Identifying the Scope
Trade-offs of Putting Many Targets in One Project
Trade-offs of Using Multiple Projects
Organizing Files
Organizing Files into Source Groups
Creating a New Source Group
Adding Files to a Group
Deleting Groups
Using Smart Groups to Organize Files
Creating a New Smart Group
Configuring a Smart Group
Viewing Groups and Files
Saving Commonly Accessed Locations
The Favorites Bar
Saving Commonly Accessed Locations as Bookmarks
Adding Comments to Project Items
Inspecting Project Attributes
Finding Information in a Project
Searching in a Project
The Project Find Window
Choosing What to Search For
Specifying Which Files to Search
Viewing Search Results
Creating Sets of Search Options
Replacing Text in Multiple Files
Viewing Project Symbols and Classes
Code Sense
Viewing the Symbols in Your Project
Viewing Your Class Hierarchy
Choosing What the Class Browser Displays
Saving and Reusing Class Browser Options
Viewing Documentation
Using the ADC Reference Library
Obtaining ADC Reference Library Content
Extended Documentation Locations
Browsing ADC Reference Library Content
Searching for Documentation
API Reference Search
Full-Text Search
Constructing Queries Using Boolean Operators
Required Terms Search
Wildcard Search
Finding Documentation for Command-Line Tools
Working With Documentation Bookmarks
Obtaining Documentation Updates
Checking for Updates
Installing an Update
Controlling the Appearance of the Documentation Viewer
Part II: Design Tools
Overview of Xcode Design Tools
Class Modeling
Data Modeling
Why Are Modeling Tools Useful?
Common Features of the Xcode Design Tools
The Diagram View
Diagram Elements
Nodes
Lines
Diagram Tools
Arrow
Text (Class Diagrams Only)
Line
Magnifying Glass
Hand
Roll-Up and Expansion
Layout
Moving and Resizing Shapes
Alignment and Grid
Automatic Layout
Locking
Zoom
Page Layout
Multiple Selection
Colors and Fonts
The Browser View
Table View Panes
Detail Pane
Info Window
Workflow
Model Files
Navigation
Contextual Menus
Class Modeling With Xcode Design Tools
Creating Models
Creating a Quick Model
Creating a Class Model File
Indexing and Tracking
The Diagram View for Class Modeling
Nodes in a Class Model
Text and Color Coding
Compartments and View Options
Lines
Annotations
Filtering and Hiding
Filtering
Hiding
The Browser View for Class Modeling
Data Modeling With Xcode
The Diagram View for Data Modeling
The Model Browser for Data Modeling
The Entities Pane
The Properties Pane
Properties View
Fetch Requests View
The Detail Pane
General Pane
User Info Pane
Configurations Pane
The Predicate Builder
Right-Hand Side
Left-Hand Side
Compound Predicates
Workflow
Creating a Model
Custom Classes
Compiling a Data Model
Part III: Editing Source Files
Inspecting File Attributes
Inspecting File, Folder, and Framework References
Choosing File Encodings
Changing Line Endings
Overriding a File’s Type
Opening, Closing, and Saving Files
Opening and Closing Files
Opening Project Files
Opening Header Files and Other Related Files
Opening Files by Name or Path
Closing Files
Saving Files
The Xcode Editor
The Xcode Editor Interface
Editing Files in a Separate Editor Window
Using the Attached Editor
Splitting Code Editors
Navigating Source Code Files
The Navigation Bar
The File History Menu
The Function Pop-up Menu
Jumping to a File’s or Symbol’s Counterpart
Searching in a Single File
Specifying Search Terms
Replacing Text
Shortcuts for Finding Text and Symbol Definitions From an Editor Window
Controlling the Appearance of the Code Editor
Setting Default Fonts and Colors
Displaying a Page Guide
Displaying the Editor Gutter
Viewing Column and Line Positions
Formatting and Syntax Coloring
Setting Syntax Coloring
Controlling Syntax Coloring and Syntax Coloring Rules
Controlling Syntax Coloring for a Single File
Wrapping Lines
Indenting Code
Syntax-Aware Indenting
Choosing What the Tab Key Does
Choosing How to Indent Braces
Choosing Which Characters Reindent a Line
Choosing How to Indent C++-Style Comments
Indenting Code Manually
Setting Tab and Indent Formats
Changing the Indent and Tab Width
Using Spaces Instead of Tabs
Matching Parentheses, Braces, and Brackets
Code Completion
Using Code Completion
Changing Code Completion Settings
Text Macros
Using an External Editor
Overriding How a File is Displayed
Changing the Preferred Editor for a File Type
Opening Files With an External Editor
Opening Files With Your Preferred Application
Customizing for Different Regions
Marking Files for Localization
Adding Files for a Region
Part IV: Version Control
Overview of Version Control
Managing Projects
Project Packages
Configuring Repository Access
Managing Files
Viewing File Status
Adding Files to the Repository
Updating Files
Removing Files From the Repository
Renaming Files
Viewing Revisions
Comparing Revisions
The Compare Command
The Diff Command
Specifying Comparison and Differencing Options
Committing Changes
Resolving Conflicts
Development Workflow
Update Your Local Copy
Make Changes
Resolve Conflicts
Publish Your Changes
Part V: The Build System
Targets
Anatomy of a Target
Creating Targets
Creating a New Target
Special Types of Targets
Aggregate
External
Shell Script
Copy Files
Duplicating a Target
Removing a Target
Target Dependencies
Adding a Target Dependency
Creating an Aggregate Target
An Example With Multiple Targets and Projects
Working with Files in a Target
Viewing the Files in a Target
Adding and Removing Target Files
Inspecting Targets
Inspecting Native Targets
Inspecting Legacy and External Targets
Editing General Target Settings
Editing Information Property List Entries
For Native Targets
For Legacy Targets
Converting a Project Builder Target
Build Phases
Overview of Build Phases
Build Phases in Xcode
Adding and Deleting Build Phases
Adding Files to a Build Phase
Processing Order
In Native Targets
In Jam-Based Targets
Reordering Build Phases
Compile Sources Build Phase
Copy Files Build Phase
Run Script Build Phase
Build Rules
System Rules
Creating a Custom Build Rule
Creating a Custom Build Rule Script
Execution Environment for Build-Rule Scripts
Build Settings
Overview of Build Settings
Build Setting Syntax
Build Setting Layers
Build Setting Evaluation
Overview of Build Setting Evaluation
Evaluating a Build Setting Defined in Multiple Layers
Evaluating a Build Setting Specification Using Several Values
Editing Build Settings in the Xcode Application
Viewing Build Settings in an Inspector
Collections of Build Settings
Editing Build Setting Specifications
Adding and Deleting Build Settings
Editing Search Paths
Creating Multi-Architecture Binaries
Editing Build Settings for Legacy and External Targets
Using Build Settings With Run Script Build Phases
Troubleshooting Build Settings
Finding Where a Build Setting is Defined
Build Setting Names and Their Corresponding Titles
Per-File Compiler Flags
Build Styles
Overview of Build Styles
Predefined Build Styles
Editing Build Styles
Viewing Build Styles for a Project
Adding and Deleting Build Styles
Modifying Build Settings in a Build Style
Building a Product
Build Locations
Changing the Default Build Location for All Projects
Overriding the Default Build Location for a Project
Building From the Xcode Application
Setting the Active Target and Build Style
Initiating a Full Build
Viewing Preprocessor Output
Compiling a Single File
Cleaning a Target
Viewing Build Status
Viewing Detailed Build Results
Specifying When Detailed Build Results are Shown
Viewing Errors and Warnings
Viewing Errors and Warnings in the Project Window
Viewing Errors and Warnings in the Build Results Window
Viewing Source Code for an Error or Warning
Controlling Errors and Warnings
Building From the Command Line
Linking
Specifying the Search Order of External Symbols
Preventing Prebinding
Linking With System Frameworks
Linking to a Dynamic Library in a Nonstandard Location
Reducing the Number of Exported Symbols
Reducing Paging Activity
Dead-Code Stripping
Enabling Dead-Code Stripping in Your Project
Identifying Stripped Symbols
Preventing the Stripping of Unused Symbols
Assembly Language Support
Preserving Individual Symbols
Preserving Sections
Dividing Blocks of Symbols
Using ZeroLink
Customizing ZeroLink
Caveats When Using ZeroLink
Optimizing the Edit-Build-Debug Cycle
Using a Precompiled Prefix Header
Creating the Prefix Header
Configuring Your Target To Use the Precompiled Header
Sharing Precompiled Header Binaries
Controlling the Cache Size Used for Precompiled Headers
Restrictions
Distributing Builds Among Multiple Computers
How Distributed Builds Work
Requirements for Using Distributed Builds
Discovering Available Computers
Sharing a Computer
Distributed Builds and Firewalls
Getting the Most Out of Distributed Builds
Predictive Compilation
Using Cross-Development in Xcode
Part VI: Debugging
Executable Environments
Executable Environments in Xcode
Setting the Active Executable
Creating a Custom Executable Environment
Editing Executable Settings
General Settings
Setting Command-Line Arguments and Environment Variables
Running a Development Product
The Run Log
Running in Xcode’s Debugger
Generating Debugging Information
Configuring Your Executable for Debugging
Starting Your Program in the Debugger
The Debugger Window
Troubleshooting
Lazy Symbol Loading
The Console Window
Debugging a Command-Line Program
Xcode and Mac OS X Debugging
Using Debug Variants of System Libraries
Using Guard Malloc in Xcode
Controlling Execution of Your Code
Breakpoints
The Breakpoints Window
Adding Breakpoints
Setting a Breakpoint at a Line of Code
Setting a Breakpoint on a Function or Method
Deleting Breakpoints
Disabling and Reenabling Breakpoints
Stopping on C++ Exceptions
Stopping on Core Services Debugging Functions
Stepping Through Code
Stopping and Starting Your Program in the Debugger
Examining Program Data and Information
Viewing Stack Frames
Viewing Variables in the Debugger Window
Using Custom Data Formatters to View Variables
Working With Data Formatters
Writing Custom Data Formatters
Using a Different Display Format to View a Variable
Using the Globals Browser
Using the Expressions Window
Viewing Disassembled Code and Processor Registers
Browsing the Contents of Memory
Shared Libraries Window
Using Fix and Continue
About the Fix Command
GDB and the Fix Command
Debugging With Patched Code
Using Fix and Continue
Restrictions on Using the Fix Command
Restrictions Reported by GDB
Additional Restrictions
Supported Fixes
Remote Debugging in Xcode
Configuring Remote Login
Creating a Shared Build Location
Configuring Your Executable for Remote Debugging
Part VII: Customizing Xcode
Customizing Key Equivalents
Customizing Command-Key Equivalents for Menu Items
Customizing Keyboard Equivalents for Other Tasks
Xcode Preferences
General Preferences
Code Sense Preferences
Building Preferences
Distributed Builds Preferences
Debugging Preferences
Key Bindings Preferences
Text Editing Preferences
Fonts & Colors Preferences
Indentation Preferences
File Types Preferences
Opening Quickly Preferences
Source Trees Preferences
SCM Preferences
Documentation Preferences
Using Scripts To Customize Xcode
Executing Shell Commands
The Startup Script and the User Scripts Menu
How Xcode Creates the User Scripts Menu
How to Add an Item to the User Scripts Menu
How to Remove Items From the User Scripts Menu
Using Variables in a Menu Definition Script
Working With Built-in Utility Scripts
Additional Customization With Scripts
Menu Script Reference
Menu Script Definition Variable Expansion
Specifying the Menu Item’s Name
Specifying the Menu Item’s Key Equivalent
Specifying Where to Get Input
Specifying Where to Place Output
Specifying Script Arguments
Specifying How to Display the Menu Item’s Output
Placing Multiple Menu Items in One Script
Pre-Execution Script Variable Expansion
Getting Text From the Active Window
Getting Information on the Active Window’s Contents
Getting the Pathname for the File in the Active Window
Getting the Pathname for the Utility Scripts
Special User Script Output Markers
Built in Utility Scripts
Specifying a String
Choosing an Existing File or Folder
Choosing a New File
Choosing an Application
Adding a Menu Item From Any Script File
Adding a Menu Item From a Menu Definition Script
Adding a Submenu
Adding a Menu Separator
Removing a Custom Menu Item
Removing All Custom Menu Items From a Menu
Appendix A: Using CVS
The cvs and ocvs Tools
Creating a CVS Repository
Creating the cvsusers Group
Creating the Root Directory
Initializing the Repository
Accessing a CVS Repository
Importing Projects Into a CVS Repository
Checking Out Projects From a CVS Repository
Updating a Local Project File to the Latest Version in a CVS Repository
Appendix B: Using Subversion
Installing the Subversion Software
Creating a Subversion Repository
Creating the svnusers Group
Creating and Initializing the Root Directory
Accessing a Subversion Repository
Importing Projects Into a Subversion Repository
Checking Out Projects From a Subversion Repository
Updating the Project File to the Latest Version in a Subversion Repository
Appendix C: Configuring Your SSH Environment
Revision History