(The following is an excerpt from "Learn Xcode Tools for Mac OS X and iPhone Development", published by APress)
Given the number of alternative choices, it might seem easy to dismiss Xcode Developer Tools (which you'll often see referred to as just Xcode Tools) and Cocoa frameworks as a choice for developing software for the Mac. It is fair to say, too, that historically Xcode and its antecedent products have not been very accessible to the new developer. The first sight of the Xcode project interface can be daunting, Objective-C has a quirky syntax, the separation of design imposed by the model view controller (MVC) pattern is a conceptual leap too far for many, and the documentation, though comprehensive, has historically not been aimed at the learner.
The need to come to grips with all of these new concepts was the main thing that prevented me from learning to develop using Cocoa and Xcode. And that is a shame, because once you get past these initial barriers, a major benefit of Apple's tools and technologies is their ease of use. Really. Many would-be developers have no doubt been put off developing using Xcode because of the multiple learning curves that need to be negotiated simultaneously. My sincere hope is that this book will help you past those learning curves, because once past them you will find Xcode an elegant, easy-to-use, and highly productive
environment in which to work.
Of course, there is one very good reason for making Xcode your development platform of choice-the iPhone. At the time of writing, there simply is no other way to create iPhone software. If you are even thinking of writing iPhone apps, then you need to learn Xcode.
Xcode, Cocoa, and Objective-C
One aim of this article is to dispel some of the confusion surrounding terminology. The new developer has not only to learn a sophisticated and complex environment and toolset, but also a range of new concepts and terms. In particular, the three terms Xcode, Cocoa, and Objective-C are often mixed up in the minds of newcomers to Mac development. Let's nail this confusion right now.
Let's start with Cocoa. This is the name given to the complete object-oriented environment within which you are working when you create software for Mac OS X and iPhone. The most visible aspect of Cocoa is the collection of code libraries known as the Cocoa frameworks. These provide you with a consistent and optimized set of prebuilt code modules that will vastly speed up your development process. The Cocoa frameworks make extensive use of the Model-View-Controller pattern: this is a very popular design approach (or pattern) for creating modern object-oriented programs.
Objective-C is a programming language, like Java or C++ or Ruby. There are plenty of great books already out there to teach you the language. Most of the software you write with Xcode Tools is likely to be written in Objective-C, but it doesn't have to be. Xcode supports a number of other languages. If you have developed software in Ruby on Rails, the above will be instantly familiar. Ruby is the programming language and Rails is the object-oriented, MVC-centered environment within which you create software.
I like to think of these terms with an analogy. In a sense, Cocoa is the world that you are living in while creating Mac and iPhone applications. The frameworks are pre-fabricated units that help accelerate your building and make your products meet the standards. The Xcode Tools are what you use to build your houses, factories, and roads. Objective- C provides your bricks and mortar. You might think of MVC as the building regulations or architectural standards that you use to make a safe and strong structure.