Master your Minecraft
 
 

Special Offers see all

Enter to WIN a $100 Credit

Subscribe to PowellsBooks.news
for a chance to win.
Privacy Policy

Tour our stores


    Recently Viewed clear list


    New Favorites | November 25, 2014

    Powell's Staff: IMG Our Favorite New Favorites of 2014



    Every week, we gather together a small pile of newly released titles that we agree should be on everyone's radar. We deem these titles our New... Continue »

    spacer

Xcode 3 Unleashed (Unleashed)

by

Xcode 3 Unleashed (Unleashed) Cover

 

 

Excerpt

Introduction

Introduction

IN THIS INTRODUCTION

  • What Xcode Is

  • What's New in Xcode 3

  • Obtaining Xcode

  • Installing Xcode

From the moment it first published Mac OS X, Apple, Inc., has made a complete suite of application development tools available to every user of the Macintosh. Since Mac OS X version 10.3, those tools have been led by Xcode, the integrated development environment Apple's own engineers use to develop system software and applications such as Safari, iTunes, Mail, and iChat. If you own a Mac, these same tools are in your hands today.

What's New in Xcode 3

In October 2007, with the introduction of Mac OS X 10.5 (Leopard), Apple introduced version 3 of the Xcode developer tools suite. Among the changes were

  • Extensive improvements to the Xcode integrated development environment (IDE), including

    • Support for Objective-C 2.0, the first major revision to the language, with commands for converting existing code to the new language.

    • Improved syntax coloring, now including distinctive colors for symbols like instance variables and method names.

    • Code Focus, a ribbon beside the editor text that lets you see how blocks of code are organized, and allows you to fold long blocks down to the height of a single line.

    • The projectwide Find command now works through the Spotlight text-searching engine, yielding better results faster.

    • A debugger bar, offering simple debugging controls in any editor window.

    • Datatips, allowing you to inspect the values of program variables during debugging, just by hovering the cursor over them in the code.

    • A mini-debugger, injected into the programs you run, permitting debugging during mouse-down events and other "volatile" situations.

    • Automatic access to the debugger whenever a program you run from Xcode crashes.

    • Improved compile-time error reporting, interleaving compiler messages with the code they relate to.

    • Automated refactoring, helping you rename classes, methods, and functions, shift methods from class to class, and even create new super classes, in an Objective-C project.

    • Much improved support for source code management tools such as Subversion, CVS, and Perforce.

    • Much improved support for using UNIX scripting languages to create and edit text.

    • The Organizer, a window to hold references to frequently used files and projects.

    • Among the command-line tools, the new xed tool enables you to open text files in Xcode, when a shell script or tool demands an interactive editor.

    • A major upgrade to the documentation system, using RSS feeds for live updates, and permitting developers to add their own documentation to the system.

    • A Research Assistant window that documents API symbols and build variables in real time, as they are selected.

  • A completely revamped Interface Builder, with better tools for crafting nonvisual parts of the human interface, such as controller objects. Integration between IB and Xcode is even tighter than before.

  • A new tool, Instruments, for profiling the resource usage (memory, I/O, graphics, threading) of a program, in real time, on a timeline so that you can see how each element of the performance picture relates to all the others.

Xcode 3 is a ground-up rebuild of the Mac OS X developer tools, and it has been well worth the wait.

Obtaining Xcode

If you have an installation DVD for Mac OS X 10.5 or a new Mac on which Leopard has come installed, you already have Xcode. On the DVD, an installation package can be found in the Xcode Tools folder inside the Optional Installs folder. On new Macs, you'll find a disk image file for Xcode Tools in the Additional Installations folder at the root of your hard drive; double-click the disk image to mount it, and you'll find the installation packages inside.

However, Apple does not always coordinate the latest version of its developer tools with its Mac OS X distributions. Even if you have an installation package on your Mac, or on your distribution disk, it pays to check for a newer version at the Apple Developer Connection (ADC).

Downloading Xcode

You must join ADC to download Xcode. Point your web browser to http://developer.apple.com/, and click the link that offers a membership (at the time of this writing, it was the Sign Up link at the top of the page). You will be offered a handful of options, some expensive. All you need is an Online membership—it's free. Fill out the forms offered to you; they will take contact information and ask you to consent to terms and conditions. There may be marketing questions and offers of mailings.

When you have completed the signup process, go to http://connect.apple.com. Fill in the username and password you chose. You will then be presented with a few options, among these being Downloads. This is what you want; click it.

Depending on your membership level, and how active Apple has been lately in releasing new software, you might not be able to find Xcode on this page. If you don't see it, click Developer Tools in the Downloads column at the right of the page. Scroll down to the first Xcode 3.x download you find (earlier releases may appear lower in the list, and versions of Xcode 2.5 may appear higher). It will be a disk image a bit over 1GB in size. This will comprise the full set of Xcode tools; there is no updater you can apply to a copy you may already have. Click to download.

Installing Xcode

Now that you have the latest Xcode package, it's time to install it. Installation packages can be run straight from a DVD, a mounted disk image file, or your hard disk. There's no difference.

In the Xcode Tools folder, you will find three installation packages:

  • XcodeTools.mpkg, which is the installation package for Xcode and the other tools needed for Mac OS X development.

  • Dashcode.mpkg provides the Dashcode IDE for producing Dashboard widgets. Dashcode is also included in the standard install from XcodeTools.mpkg; this package is for those who are interested only in developing widgets.

  • WebObjects.mpkg installs Apple's excellent WebObjects frameworks and tools, for developing sophisticated database-centered websites in Java. WebObjects is also available as an optional install from within the Xcode Tools Installer.

You will also find a folder named Packages, containing installation packages for components of the Xcode tools, like the CHUD performance-measuring suite, software development kits (SDKs) for X Window and earlier versions of Mac OS X, and version 3.3 of the gcc compiler suite (for PowerPC Macs only). All these are available as options (or within options) in the Xcode Tools Installer, but are here in case you omit them from the original installation and want to add them later.

If you've ever done an installation under Mac OS X, the Xcode tools install is familiar (see Figure I.1). Start by double-clicking the XcodeTools.mpkg installation package. A Welcome screen appears, at which you will press Continue. Next, the installer displays the license for Xcode and its related software; click Continue, and if you accede to the license, click Agree in the ensuing sheet.

Figure I.1 The Welcome panel for the Xcode Tools Installation package should be familiar to any experienced Mac user.

You are now at the Standard Install panel, but we will vary from the standard line. Click the Customize button to reveal the Custom Install panel. This panel (see Figure I.2) contains a table listing the components of the Xcode Tools installation. The single mandatory component is checked and grayed out; the optional components are active, and you can check or uncheck them to include or exclude them from the installation:

  • Developer Tools Essentials. This is Xcode itself, and the graphical and command-line programs that complement it, plus SDKs for developing Mac OS X software for versions 10.4 and later. This is a mandatory component; it doesn't make sense to install the developer tools without installing Xcode and the tools needed for it to run.

  • Figure I.2 The Custom Install panel for the Xcode Tools Installer. The top entry in the package list is for the core Xcode tools, and is not optional. In the Location column is a pop-up menu from which you can select where the developer tools are to go; the default is the Developer folder of your boot disk.

  • Developer Tools System Components. These are the CHUD tools for investigating application performance, plus facilities for distributing application builds over more than one computer. You should install this package.


  • Note - CHUD, gcc 3.3, and WebObjects are not flexible about where they are installed. They will be installed into /Developer no matter what location you choose for the Xcode tools.


  • UNIX Development Support. The "essentials" installation of Xcode installs components such as compilers and their support files in a usr subdirectory of the installation directory. If you will be doing command-line development—for instance, for building open source projects—you will want a set of development tools installed in the root /usr directory tree. This package installs copies of the command-line tools into /usr. You should install this package; examples in this book depend on it (see Chapter 24, "A Legacy Project").


  • Note - The gcc compiler suites installed with the Xcode tools are Apple-modified builds that take account of such Mac OS X features as frameworks and support for Objective-C 2.0. They are not the same as the gccs available under the same version numbers from the Free Software Foundation.


  • Core Reference Library. This package installs the panoply of introductions, references, technical notes, and sample code that document development on Mac OS X and the APIs you need to do it. Install this package.

  • Mac OS X 10.3.9 Support. Installs the SDK and tools needed to produce software that targets Panther (Mac OS X 10.3). This includes version 3.3 of the gcc compiler suite, for PPC Macs only. This package is left out of the standard install, and whether you need it depends on whether you intend to build applications for 10.3 (see Chapter 17, "Cross-Development").

  • WebObjects. This package installs the applications and files needed to develop web applications with Apple's WebObjects framework. You need not install this package.

Unlike earlier versions, Xcode 3 and 2.5 are flexible about where you install them. This is where you would make that choice. See the section "Another Install Location" for details.


Note - Earlier versions of Xcode offered to install reference material for the current Java development kits. These are still available through the Downloads section of ADC.



Note - With Xcode 3, Apple has dropped support for developing software aimed at Jaguar (Mac OS X 10.2). If you need to target 10.2, you must install Xcode 2.5 and use its 10.2.8 SDK. You cannot use Xcode 2.5 to build software using 10.5 technologies.


Now click the Install button. The standard authentication sheet will appear, into which you enter the name and password of an administrative user of your Mac.

The next panel contains a progress bar and a narrative of what is being installed. This process takes a number of minutes, at the end of which you are rewarded by a big green check mark. Close the installer; you are now ready to use Xcode.

Another Install Location

Earlier versions of Xcode (earlier than 2.5) installed themselves only in the /Developer directory of the startup file system. Having one possible path to all the developer tools greatly simplified the task of locating them: If you needed the packagemaker tool, it was at /Developer/Tools/packagemaker, and that was that.

Things have changed since then. First, the Xcode package has grown larger and larger. The download package alone is 1.1GB in size, which expands to 3.3GB installed. It is reasonable to want to put Xcode onto another disk or partition. Second, it is now possible to install Xcode 2.5 (see the section "Xcode 2.5" that follows) in parallel with Xcode 3, and the two tool sets necessarily need two homes.

That is why, during your installation of Xcode, /Developer is still the default location, but you can choose another.

If you want another location, ignore the Change Install Location button on the Standard Install panel. The Installer application offers this button as a standard part of its workflow; if you press it, you will find that the boot volume is your only choice. If you find yourself at the Install-Location panel, click the Go Back button to back out.

The real choice comes in the Custom Install panel. In the Standard Install panel, click the Customize button to get to a list of components to install. The top line, Developer Tools Essentials, has a pop-up menu for setting the location for installing the Xcode tools (see Figure I.2). The default location, /Developer, is shown initially.


Note - Yes, you can put Xcode wherever you want, but accounting for that possibility in every reference to a component of the developer tools would make this book more tedious than it has to be. I'll just refer to the Xcode tools directory as /Developer, and trust you to make the transposition yourself.


Change the location by selecting Other from the pop-up. A standard open-file sheet will appear. Find the directory that you want to contain your Xcode directory. Use the New Folder button to create the Xcode directory there. Make sure that directory is selected, and then click Choose. The selected directory will contain the Applications, Documentation, and other directories that make up the Xcode tool set.

You can continue the installation from there, as before.

Uninstalling Xcode

All things come to an end, and there is no exception for Xcode. There are two reasons you might choose to remove Xcode from your hard drive. The first is that you just do not want it; you want the files gone, and the space reclaimed.

The second is that you want to install a later version of Xcode. When Apple comes out with new versions of Xcode, it does not distribute updaters. Only the full Xcode tools package will be available for download. Past experience has shown that a full upgrader is a bigger and more accident-prone undertaking than the Xcode team can sustain, especially when the alternative is to have Xcode users simply remove the earlier version and install the new version afresh.

The developer tools come in two parts. The most prominent is the /Developer directory itself, which contains all the graphical applications, documentation, and SDKs that make up the public face of Xcode. The other part is the tools embedded throughout the UNIX file system that make development possible. For instance, two versions of the gcc compiler are installed at /usr/bin; all the headers needed for development on the current system are in the huge /usr/include hierarchy. To properly uninstall the developer tools, these, too, have to be picked through and removed.

The first part of the uninstallation is easy: Find your Xcode tools directory, and drag it into the trash. That's 100,000-plus files gone.

Next, execute the tool /Library/Developer/Shared/uninstall-devtools from the command line. uninstall-devtools is a Perl script that walks through the saved installation receipts looking for every developer tools package going back to 2001. It deletes the files of every package it finds. Running uninstall-devtools will take a few minutes. At the end, you have a system fit for a fresh install.

This procedure is good enough if you mean to reinstall the developer tools. If you mean to go further, you also want to delete the directories /Library/Developer and ~/Library/Developer, and the preference files for the individual developer applications. The usual procedure spares these, because they contain customization files you may have created, which you would want to carry over to a new installation.

Xcode 2.5

Many people have commitments to Xcode 2 that they can't get out of, even if they are running Leopard. Managers of a project nearing completion, with many developers, may be reluctant to revalidate their build processes for a new tool chain.

They might have NIBs that rely on palettes for Interface Builder 2, which are not usable in IB 3. Further, although Xcode and Interface Builder do provide "compatibility" modes, it is easy to produce files that earlier versions cannot open. Holding off on Xcode 3, at least for some projects, can be prudent.

That is why Apple released, in parallel with Xcode 3, Xcode 2.5. The Xcode 2.5 tools are strictly file compatible with those of the preceding version, Xcode 2.4. Unlike version 2.4, 2.5 can run on either Tiger (Mac OS X 10.4) or Leopard (10.5).

Like Xcode 3, Xcode 2.5 permits you to choose where to install its developer tools. As with the Xcode 3 installation, you are offered a Customize button for editing the components to be installed. The top component, representing the core developer tools, will have a pop-up enabling you to chose where to install Xcode 2.5. The default location is /Xcode2.5.

If you intend to develop specifically for Mac OS X 10.5, Xcode 2.5 is not for you; it does not support the Leopard SDK. For Leopard development, you have to use Xcode 3.

If you have Project Builder (.pbxproj) projects around, now is the time to convert them to Xcode projects, and 2.5 is the tool to do it. Xcode 3 has dropped the capability to import Project Builder projects.

Having two Xcodes on your system gives you two versions of Xcode-related command-line tools such as xcodebuild. If you opt (as I strongly recommend) to install tools in /usr/bin, it is a nice question which version of a tool is run when you execute it from the command line or a build script. The solution is this: The /usr/bin versions of these tools are in fact scripts that refer to the binary versions in the Xcode 3 or 2.5 install tree. You determine which version is used by running the xcode-select tool; man xcode-select for details.

© Copyright Pearson Education. All rights reserved.

Product Details

ISBN:
9780321552631
Author:
Anderson, Fritz
Publisher:
Sams
Subject:
Programming Languages - General
Subject:
Operating systems (computers)
Subject:
Macintosh (computer)
Subject:
Programming - Software Development
Subject:
Software Engineering - Programming and Languages
Copyright:
Edition Description:
Trade paper
Series:
Unleashed
Publication Date:
June 2008
Binding:
TRADE PAPER
Grade Level:
Professional and scholarly
Language:
English
Illustrations:
Y
Pages:
560
Dimensions:
9.1 x 7 x 1.007 in 1084 gr

Other books you might like

  1. Learning Cocoa Used Trade Paper $5.95

Related Subjects

Business » Human Resource Management
Business » Management
Computers and Internet » Apple » OS X » Programming
Computers and Internet » Apple » Programming
Computers and Internet » Computers Reference » General
Computers and Internet » Software Engineering » Programming and Languages
Travel » General

Xcode 3 Unleashed (Unleashed) Used Trade Paper
0 stars - 0 reviews
$8.95 In Stock
Product details 560 pages Sams - English 9780321552631 Reviews:
spacer
spacer
  • back to top

FOLLOW US ON...

     
Powell's City of Books is an independent bookstore in Portland, Oregon, that fills a whole city block with more than a million new, used, and out of print books. Shop those shelves — plus literally millions more books, DVDs, and gifts — here at Powells.com.