INTRODUCTION

WELCOME TO PROFESSIONAL XCODE 3. The Xcode Development Tools is Apple's free suite of software development resources. The Xcode Development Tools package includes project organizers, editors, utilities, debuggers, software development kits, and documentation.

Xcode is uniquely qualified to produce native solutions both for Apple's Mac OS X operating system and the popular iPhone and iPod Touch devices. If your development plans include Mac OS X or the iPhone OS, Xcode is the only rational choice for your development platform.

The size, complexity, and depth of Xcode are both a blessing and a curse. In your favor, you have a wealth of development tools, templates, and documentation, but all that comes at a cost; there's so much to learn and explore that it might take you months — even years — to fully exploit its capabilities. That's where this book comes in.

Professional Xcode 3 takes you on a detailed tour of the Xcode integrated development environment. Besides just explaining features, it will tell what those features are best used for, and give you some sound advice on making your Xcode workflow smooth, effective, and efficient.

It's as important to known what this book is not about. This book is not an introduction to programming on Mac OS X or the iPhone. You won't find any "Hello World" projects in these pages. This book is the guide that you'll need after you've built that example project and are ready to build your own. Do you start another project or create a second target? What if you want to share code between two projects? Do you copy the files, use source control, define a source tree, or use project-relative references? Confused? This is the book where you'll find the answers to those questions, the pros and cons of each approach, and some practical advice on which solution is best for you.

WHO THIS BOOK IS FOR

This book is for anyone who wants to get the most out of Xcode. It's for anyone creating multiple projects, large projects, projects that produce multiple products, and projects that need to be built for different deployment targets. It's for anyone working on an open source project, setting up source control, sharing development assets between projects, or collaborating with other developers.

This book is for anyone who wants to write source code efficiently, navigate between files, quickly rename variables, or refactor a class. This book covers the length and breadth of the Xcode editors, their navigation, syntax coloring, and code completion. It describes the many search and replace functions, class browsing, class modeling, and class refactoring.

This book is for anyone who's ever tried to find something in the documentation. It explains the documentation help viewer, research assistant, and quick help. It explains how to search the documentation by topic, symbol name, and how to filter the results by programming language. It shows you shortcuts for jumping from your source code right to the definition or documentation of any function, class, or symbol.

This book is for anyone who needs to debug, analyze, and polish a Mac OS X or iPhone application. It explains how to use the debugger, create and set complex conditional breakpoints, create custom data interpreters, debug on a second computer remotely, and debug full-screen applications. It shows you how to look for inefficient code, track down memory leaks, catch application crashes, and debug an application that's already running.

Finally, this book is for anyone who wants to automate their workflow. This book explains how to add custom script phases to targets, custom code templates in the editor, write breakpoint actions that run during debugging, attach action scripts to their project, and share those solutions with other developers.

WHAT THIS BOOK COVERS

This book covers the Xcode Integrated Development Environment (IDE) application. The Xcode Development Tools is the suite of resources that includes the Xcode application. Xcode (the application) is your cockpit, your command center, which drives the whole of the rest of your development system. While there are many interesting things you can do with the development tools, this book concentrates on Xcode (the application) and an Xcode-centric workflow. It shows you how to use your compilers, debuggers, linkers, data models, source control, documentation, and automation tools — all without ever stepping outside the Xcode application.

This book covers other important developer tools, particularly those that you'll use in conjunction with Xcode. The most significant are Interface Builder, Instruments, and Shark. All of these tools work hand-in-glove with Xcode, and you'll learn how to seamlessly transition between them.

This book also serves as a guide to additional research. No single book could possibly cover every aspect of Mac OS X and iPhone OS development. Apple produces a vast amount of high-quality documentation. This book often sketches the outline of a common solution, and then points you to the documentation or resource where you can explore the topic more completely.

HOW THIS BOOK IS STRUCTURED

Professional Xcode 3 is broadly organized in the order you typically develop a project. Of course development is never a linear process, but the chapters mimic the general steps you take when producing software:

  • Create a project

  • Populate it with source files and other resources

  • Write code

  • Edit your code and make global changes

  • Analyze your code's structure

  • Look up APIs in the documentation

  • Design a user interface and connect it to your code

  • Create data models

  • Add project targets

  • Build your project

  • Debug your project

  • Analyze its performance

  • Collaborate with other developers

Each chapter includes a brief introduction to the topic, followed by successively more detailed explanations of the technology. If you want to learn everything about, say, targets you can read Chapter 16 from start to finish. But if you only need to answer the question "should I create a target or a new project," that answer is in the first couple of sections. If you don't need to create a new target, you can move on. Come back later when you need to create a target, or customize an existing one.

I've tried to organize the book topically so that it can serve as a resource for future research. When you first create a data model in Core Data, you probably aren't worrying about developing a migration map to the next version of your data model. But when you do create that second version, I trust that you'll know where to open the book and find the answer. (Hint, it's in the Data Modeling chapter.)

WHAT YOU NEED TO USE THIS BOOK

This book was written for Xcode 3.2. To use Xcode 3.2, you will need the following:

  • An Intel-based Macintosh computer running Mac OS X 10.6 (a.k.a. Snow Leopard) or later

  • An Apple developer account (either iPhone or Mac OS X, a free account is sufficient)

  • For iPhone development, you'll eventually need an iPhone or iPod Touch device and an iPhone developer account — but you can get started without one

  • At least 10 GB of free disk space

Even though Xcode 3.2 will only run on an Intel-based Macintosh running 10.6, Xcode can produce applications compatible with PowerPC-based systems, Mac operating systems as old as Mac OS X 10.4, and any version of the iPhone OS.

CONVENTIONS

To help you get the most from the text and keep track of what's happening, we've used a number of conventions throughout the book.

As for styles in the text:

  • We highlight new terms and important words when we introduce them.

  • We show keyboard strokes like this: Command+A.

  • We show file names, URLs, and code within the text like so: persistence.properties.

  • We present code as follows:

We use a monofont type with no highlighting for most code examples.

SOURCE CODE

As you work through the examples in this book, you may choose either to type in all the code manually or to use the source code files that accompany the book. All of the source code used in this book is available for download at http://www.wrox.com. Once at the site, simply locate the book's title (either by using the Search box or by using one of the title lists) and click the Download Code link on the book's detail page to obtain all the source code for the book.

Note

Because many books have similar titles, you may find it easiest to search by ISBN; this book's ISBN is 978-0-470-52522-7.

Once you download the code, just decompress it with your favorite compression tool. Alternately, you can go to the main Wrox code download page at http://www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

ERRATA

We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books, like a spelling mistake or faulty piece of code, we would be very grateful for your feedback. By sending in errata you may save another reader hours of frustration and at the same time you will be helping us provide even higher quality information.

To find the errata page for this book, go to http://www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page you can view all errata that has been submitted for this book and posted by Wrox editors.

A complete book list including links to each book's errata is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don't spot "your" error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We'll check the information and, if appropriate, post a message to the book's errata page and fix the problem in subsequent editions of the book.

P2P.WROX.COM

For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a Web-based system for you to post messages relating to Wrox books and related technologies and interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At http://p2p.wrox.com you will find a number of different forums that will help you not only as you read this book, but also as you develop your own applications. To join the forums, just follow these steps:

  1. Go to p2p.wrox.com and click the Register link.

  2. Read the terms of use and click Agree.

  3. Complete the required information to join as well as any optional information you wish to provide and click Submit.

  4. You will receive an e-mail with information describing how to verify your account and complete the joining process.

Note

You can read messages in the forums without joining P2P but in order to post your own messages, you must join.

Once you join, you can post new messages and respond to messages other users post. You can read messages at any time on the Web. If you would like to have new messages from a particular forum e-mailed to you, click the Subscribe to this Forum icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset