AppleInsider is supported by its audience and may earn commission as an Amazon Associate and affiliate partner on qualifying purchases. These affiliate partnerships do not influence our editorial content.
Xcode 4 presents an entirely new user interface and workflow for developers, along with new components for compiling, debugging and finding and correcting common errors. The result: better, faster code from more productive developers.
One window to bind them all
The first major feature of Xcode 4, according to developers familiar with Apple's plans, is the shift from the multiple window workflow that Xcode (and its predecessor, NeXT's Project Builder) currently uses to a new single window interface.
Rather than spawning new windows to search code, debug, build, and set parameters, everything can be done within a single window that echoes components of the design of iTunes, including a LCD-like status display.
The new window presents a dismissible Navigator control (akin to iTunes' Source List), with icon tabs that can present a variety of different types of development-related information within the same window column:
- a listing of projects and files
- a symbol listing of classes and methods
- a search feature that lists project-wide results
- an issues listing of build errors
- debugging information
- a listing of build logs
The main area of the new Xcode windows is devoted to the document being viewed, whether code, a data model, or the project's graphical interface. This area can also be segmented to view multiple documents, presenting a comparison of their differences (such as for comparing two versions of the same code file). The content area also integrates support for viewing PDFs and other file types supported by the extendable Quick Look feature.
Above the content area is a new Jump Bar, which presents a hierarchical "breadcrumb" listing similar to the Path Bar introduced in iTunes and the Finder. The difference is that the new Jump Bar is fully interactive; users can click on any path along the bar and select a popup that allows them to navigate at that level. For example, in the photo below, a user can click on Resources within the Jump Bar to view (and directly jump) to other resource files within that directory via a dynamic popup window that is displayed.
On page 2 of 3: Now including Interface Builder.
Apple's Xcode Mac OS X developer tools, adapted alongside the iPhone 2.0 SDK to also create iOS mobile apps, originally included Project Builder for working with code and Interface Builder for laying out a program's graphical user interface and mapping elements of the GUI to the code that made it functional.
Back in the late 80s, the original developer of Interface Builder, Jean-Marie Hullot, showed the graphical development concept to Apple but was wooed away to Steve Jobs' NeXT Computer, which made the advanced GUI builder part of its development tools.
Interface Builder was used to rapidly develop Tim Berners-Lee's WorldWideWeb browser at CERN. Apple later acquired the technology when it bought NeXT in 1996, making it part of the Mac OS X development tool package with Project Builder, which the company has since renamed Xcode.
In Xcode 4, Interface Builder is folded into the revamped Project Builder-based IDE to create a single tool for creating both the appearance and the functionality of applications. The deep integration between the two components provides a variety of improvements in developing mobile and desktop applications.
Graphical elements can now bind their outlets and actions right into source code using a graphical drag and drop gesture. A new Assistant feature in Xcode 4 allows developers to work on the GUI and source code at the same time (below).
On page 3 of 3: Fixit, LLVM, LLDB, Instruments.
Developers report Apple has also introduced a new Fixit feature that provides advanced code completion and flags common bugs or typos using the same red underlining that Mac OS X uses system wide to indicate spelling errors.
The Fixit feature can suggest appropriate symbol spellings and supply correct punctuation, assisting developers to write code faster while making fewer mistakes. A static analysis can find and flag common bugs and errors such as a failure to properly release memory that is no longer needed.
Xcode 4 is also reported to support new version control features for collaborative development, enabling coders to checkout, commit changes and update content in projects stored on Subversion and Git version control systems (which work with multiple versions of files over time, like Time Machine).
New tools also allow users to compare different files for changes over time that have been checked into a version control system and revert or merge code into the latest version.
Apple shares new LLDB debugger as open source with LLVM
Xcode 4 is also reported to include a significant new version of the modern Low Level Virtual Machine (LLVM) Compiler, which Apple has been supporting as an open source project to eventually replace GNU Compiler Collection (GCC), the tool most Unix-based development systems use to convert source code to executable object code targeted to a specific processor.
LLVM is a modular compiler system designed to create faster, more optimized code. The new LLVM Compiler 2 now supports C++ in addition to the C and Objective C languages, and compiles code up to twice as fast as GCC. The code it creates also runs faster than code compiled with GCC, with Mac OS X code reportedly running up to 25% faster and iOS code running as much as 60% faster, just through improvements made in optimizing the compilation of the same source code.
Also within Xcode 4 is an entirely new debugger system Apple designed for performance and efficiency, resulting in faster finding and fixing of bugs. The new debugger is modeled after LLVM's modular architecture, and is therefore named LLDB. Apple is also said to be releasing its internal LLDB project as open source, and will make it available to third parties alongside the open source LLVM compiler.
Playing new Instruments
Another major feature delivered alongside Xcode 4 will be a new version of Instruments (originally code named Xray), Apple's graphical tool for code performance profiling based on Sun's DTrace technology.
The new Instruments adds new time profiler support for iOS development, and includes new features that help developers examine how their application code interacts with other apps and the system's kernel, in order to find where apps are spending their processing time and allocating their resources in a very complex computing environment.
Instruments is also said to include support for identifying abandoned memory that has been referenced but not actually needed, enabling developers to reduce the memory footprint their apps demand. The tool will also add profiling analysis support for OpenGL ES, an important tool for iOS developers building high performance games and other apps that make use of sophisticated graphics.