Xcode 4
Richard Wentk
Xcode 4
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright 2011 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-118-00759-4
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, 201-748-6011, fax 201-748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002.
Library of Congress Control Number: 2011929798
Trademarks: Wiley and the Wiley logo are registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. Xcode is a registered trademark of Apple, Inc. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.
Dedication
To Zofia
About the Author
Richard Wentk is one of the U.K.'s most reliable technology writers, with more than ten years of experience as a developer and more than fifteen years in publishing. He covers Apple products and developments for Macworld and MacFormat magazines and writes about technology, creativity, and business strategy for titles such as Computer Arts and Future Music . As a trainer and former professional Apple developer returning now to development on the iPhone and OS X, he is uniquely able to clarify the key points of the development process, explain how to avoid pitfalls and bear traps, and emphasize key benefits and creative possibilities. He lives online but also has a home in Wiltshire, England. For details of apps and other book projects visit www.zettaboom.com .
Credits
Acquisitions Editor
Aaron Black
Project Editor
Martin V. Minner
Technical Editor
Brad Miller
Copy Editor
Gwenette Gaddis
Editorial Director
Robyn Siesky
Editorial Manager
Rosemarie Graham
Business Manager
Amy Knies
Senior Marketing Manager
Sandy Smith
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Barry Pruett
Project Coordinator
Katie Crocker
Graphics and Production Specialist
Carrie A. Cesavice
Quality Control Technician
Rebecca Denoncour
Proofreading and Indexing
Christine Sabooni
BIM Indexing & Proofreading Services
Media Development Project Manager
Laura Moss
Media Development Assistant Project Manager
Jenny Swisher
Media Development Associate Producers
Josh Frank
Shawn Patrick
Doug Kuhn
Marilyn Hummel
After a few years with Xcode 3, my first impressions of Xcode 4 were mixed. At first, I thought the redesign was unnecessarily rigid and proscriptive. I missed Interface Builder's floating windows and object palettes, and I couldn't find a convincing reason for the enforced three-way window split in the editor.
Over time, I realized my first impressions were wrong. Software tools for developers, like software tools for users, should work hard to make life easier. The venerable old GCC compiler toolchain that ran under the hood of Xcode 3 was developed at a time when the command line was the only available UI. Although some developers still love the command line, it's an unforgiving environment that penalizes simple mistakes. It can be powerful, but it's also literal-minded and not at all transparent.
Many development environments, including Xcode 3, have taken this same approach but applied it in a visual environment. The test of a good tool is that it anticipates your needs to the point where it disappears, leaving you with a clear canvas for your imagination.
Xcode 4's designers have taken a step toward this by asking how to simplify or eliminate some of the tedious and repetitive work that was necessary in the past. Xcode 4 doesn't accomplish this aim completelysome promising early ideas were removed in the final releasebut many of the features are simpler and more responsive than their equivalents in Xcode 3. As a result, the development process is faster, simpler, and more productive.
The first goal of this book is to introduce the new features to users who were used to older ways of working and to bring new users up to speed with the essential features of Xcode. Newcomers should start at the front of the book and work their way through it in order. The sequence of the earlier chapters is designed to be a practical primer for Xcode development, not just a list of features and changes.
A second goal is to introduce some of the more complex features in more detail. Many newcomers use Xcode in a simple click-bang way, missing out on the power and flexibility hidden under the surface. The less-obvious features are easy to skip, but exploring them can open up new possibilities for testing, debugging, project management, and build control. Some tools, such as Instruments, have further hidden layers of their own that would require a further book the size of this one to explore fully.