Introducing Xcode 4 (iOS 4)

Now that you have Xcode and the iOS SDK installed, and you’ve learned a bit about the puzzle pieces needed to build an application, you’re ready to write your first HelloWorld application. The main purpose of this topic is to show you the new features in Xcode 4 and how Xcode works. Using a traditional HelloWorld application, we’ll look at the parts of a standard application, and you’ll learn how to build and run your first iOS application. Then we’ll look at how Interface Builder works under Xcode 4. And last, you’ll create the AppleStock application, which shows how to create new objects, manipulate them graphically, and use the inspector window.

At the time of this writing, Xcode 4 is a brand-new release to iOS developers. With a new user interface, Xcode 4 also includes a lot more changes under the hood. Let’s first look at the new features in Xcode 4.

When Xcode 4 was first introduced at Apple’s WWDC 2010, developers were excited and looked forward to the new features in Xcode 4. Compared to Xcode 3, Xcode 4 is more powerful, more tightly integrated, easier to use, and great for organizing your projects.

Note that you can have both Xcode 4 and Xcode 3 installed on your Mac at the same time, and the existing project will be fully compatible in Xcode 4.

Let’s look at the advantages in Xcode 4:

■ Single-window interface—You can create a workspace and add multiple projects under the same workspace and edit them in the same window. In Xcode 4, Interface Builder is fully integrated as part of the Xcode application, making it much easier to connect objects between the source code and the graphic design interface.


■ Source control—Although this isn’t an exciting topic, Xcode 4 makes it a lot easier to control and compare the new changes with version control and Git. New projects are even given the option to automatically have a Git repository created. Version Editor provides the side-by-side view for any two versions of a file.

■ LLVM 2.0 compiler includes full sup/port for C, Objective-C, and C++—The benefit is in the speed of compiling and linking, as well as improvements to syntax highlighting and code completion driven by the new LLVM parser.

■ Powerful debug support—The Fix-it feature presents the potential solution for the issue inside the program.

■ Scheme concept—Instead of creating each platform as a build target, you can use Xcode Schemes to collectively define targets to build, the configuration to be used, and the associated tests to execute.

There are more features in Xcode 4. You can find out the details from the iOS Dev Center. Now let’s launch the Xcode 4 application on your Mac.

Next post:

Previous post: