Chapter 3. Xcode

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • How to create new projects in Xcode

  • How to organize files in an Xcode project

  • How Xcode can help you write and format your code

  • How to build and run your application, and examine your project in Xcode's built-in debugger

  • How to access online documentation through Xcode

When programming for Mac OS X, you spend most of your time in Xcode. Xcode is an Integrated Development Environment, or IDE, meaning that Xcode provides all the tools you need to write, build, and debug Mac OS X programs in a single application.

Xcode's text editing tools are specifically designed for writing computer programs. Source code is typically displayed in a small monospaced font so that programmers can tell at a glance if their code is formatted properly. In addition, source code can be color-coded so that specific parts of the program stand out. For example, comments that aren't compiled into your program may appear in a different color from the rest of the code.

Xcode also provides tools for building your source code within easy reach. You can easily change your build settings to adapt to different situations, such as testing or deploying your program. If for some reason your code will not compile, Xcode displays the list of errors encountered in the build process and allows you to fix your mistakes.

After your code has compiled into the final application, you can launch the program directly from Xcode. If the program doesn't work right, or if it crashes, you ...

Get Beginning, Mac OS® X Snow Leopard™ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.