Inside Apple's new Xcode 4 development tool

Posted:
in Mac Software edited January 2014
At WWDC, Apple treated its Mac OS X and iOS programmers to a preview of its entirely revised Xcode 4 integrated development environment. Here's a look at what's new and how it matters for end users.



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

breakpoints

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.



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.



The Fixit feature



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.
«1345

Comments

  • Reply 1 of 95
    "Developers report..."



    Yeah, you could at least credit Apple's development videos for all the info here that you are publishing.
  • Reply 2 of 95
    mactelmactel Posts: 1,275member
    Looks like a great IDE. Having been a MS Visual Studio developer for over a decade I can appreciate the single window IDE. However, hearing how others used the multi-window IDE with spaces it seems so people won't like the change.



    I'll give Xcode a try for myself when this new version is fully released. I have a few ideas I'd like to pursue for iOS apps.
  • Reply 3 of 95
    kegankegan Posts: 1member
    Any information regarding release date?
  • Reply 4 of 95
    auclaucl Posts: 19member
    Even in the current released version there is a "all in one" mode.



    when can we get that new version? any word on that?
  • Reply 5 of 95
    I'm currently watching the dev videos.



    Quote:

    The deep integration between the two components provides a variety of improvements in developing mobile and desktop apps, as 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.



    I love the fact when designing the GUI, while in splitview, you can literally drag a line from a Button or a Slider to the source code on the right-side and inserts binding code on the fly.



    Quote:

    The Fixit feature can suggest appropriate symbol spellings and supply correct punctuation, assisting developers to write code faster while making fewer mistakes.



    Fix-it's spellcheck feature is awesome. It alerts you if you typed a class name that doesn't exist and it even suggests a list of possible corrections before you even compile.



    Also in split-view, selecting the implementation classes on the left side for editing/viewing automatically displays the interfacing classes on the right while you navigate in the Jump Bar.



    I noticed Xcode 4 does have some resemblance to iTunes with that stop and playback buttons along with the new status bar at the top.



    Quote:

    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.



    Its called the Blame tool.
  • Reply 6 of 95
    Just as I'm trying to learn the Xcode 3, they change it again? Is there a good reference for Xcode 4 anywhere?
  • Reply 7 of 95
    nvidia2008nvidia2008 Posts: 9,262member
    This single-window stuff and version control looks good. I'm not a developer though, I just dreamt last night I went to Perth (Australia) to do my Masters degree in iOS development. Weird, huh.
  • Reply 8 of 95
    nvidia2008nvidia2008 Posts: 9,262member
    "I'm not an iOS developer, I just play one on TV..."
  • Reply 9 of 95
    Now the XCode editor finally catches up to Visual Studio, Eclipse, and Netbeans. The code completion and debugging was inferior to those IDEs. Now Apple is applying a formula that works, which is the single window view of the other IDEs.



    Still, they managed to also come up with at least one brand-new idea. The code and GUI side-by-side view is something I haven't seen, but is a fantastic idea.
  • Reply 10 of 95
    nvidia2008nvidia2008 Posts: 9,262member
    So now we'll have another 500,000 apps to choose from since Xcode 4 development is so easy? Hmm, "there's an app for that" could become "well, there's 4,000 apps for that, good luck wading through them all".
  • Reply 11 of 95
    SpamSandwichSpamSandwich Posts: 31,015member
    Quote:
    Originally Posted by richwiss View Post


    Just as I'm trying to learn the Xcode 3, they change it again? Is there a good reference for Xcode 4 anywhere?



    I've been working on an app for a whole year+! Over a year! Am I just stupid or is this stuff difficult... (don't answer that!)
  • Reply 12 of 95
    Quote:
    Originally Posted by JavaCowboy View Post


    Now the XCode editor finally catches up to Visual Studio, Eclipse, and Netbeans. The code completion and debugging was inferior to those IDEs. Now Apple is applying a formula that works, which is the single window view of the other IDEs.



    Still, they managed to also come up with at least one brand-new idea. The code and GUI side-by-side view is something I haven't seen, but is a fantastic idea.



    I HATE single window view mode in XCode. I almost broke my laptop keyboard back when XCode was morphing to single-window-mode (so it was the only mode you could use) back in the original XCode 1.0/2.0 days [yes, I was actually pounding it in frustration. I wound up buying an external keyboard just so I would stop hitting my laptop]. Now, it has an 'all-in-one' mode, but you can change to a separate-window-for-everything mode, which I find works much better [except of course, when debugging, when I wish it would use the old CodeWarrior behaviour of hiding all the 'edit' windows leaving only the debugging related windows visible.



    Invariably, I find that single-window-mode apps always need to be adjusted. The list of files in the project needs to be wide enough so you can see all the filenames, even when they are long and indented, but it's a total waste of screen space when you're actually editing a file.



    Even the debugger window layout in XCode sucks right now, because variables, stack and current PC are all stuffed in one window. In particular, the variable display likes to be wide, to be able to display the actual variable name and value, while the stack display doesn't have to be that wide/tall. I find I constantly have to adjust the relative size of the three things to view what's important at any given instant, then readjust it when different part gains in importance. If they were separate windows, I would rarely need to resize the windows, just switch which one was in front.



    And yes, it also pisses me off that radar entries about it get marked as 'duplicate' and seem to get sent to /dev/null.
  • Reply 13 of 95
    bertpbertp Posts: 274member
    Quote:
    Originally Posted by AppleInsider View Post




    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.




    I have often wondered if LLVM is being utilized now by Apple and third parties to generate code for distribution. Or does GCC remain the workhorse? Does anyone know?



    Edit: substitute 'binaries' for 'code'
  • Reply 14 of 95
    melgrossmelgross Posts: 31,507member
    As iOS is somewhat related to development on the iPhone family of devices. I thought this article about it might be of interest:



    http://www.tipb.com/2010/06/14/ios-4-walkthrough/
  • Reply 15 of 95
    synoticsynotic Posts: 151member
    Time Machine is based on Subversion? Is there any source for this? I checked Google and the only thing I could find was some guy in 2006 speculating that it uses Subversion.
  • Reply 16 of 95
    leafyleafy Posts: 34member
    Quote:
    Originally Posted by JavaCowboy View Post


    Still, they managed to also come up with at least one brand-new idea. The code and GUI side-by-side view is something I haven't seen, but is a fantastic idea.



    Any GUI editor in Eclipse can do that in a split-pane like view, it's not new at all.
  • Reply 17 of 95
    asciiascii Posts: 5,941member
    The code editor in XCode has always been fine, except that autocomplete doesn't work like you'd expect (hint: Bash, Eclipse and Visual Studio all use TAB).



    The confusing part has always been the build system. It doesn't use the standard concepts/terminology. For example it refers to a build script as a "target." Which is a little too nouny for a processy thing. Supposedly they have the term "scheme" is the new version, which sounds like another confusing reinvention of something that should be simple.



    And don't get me started on the search and replace. A hundred options no one cares about.



    And the preferences window - so ugly.



    The whole thing is just a dog's breakfast of confusing terminology, non-intuitive GUI, and useless reinvention. There would be twice as many apps on the app store with a better IDE.



    But enough of this meanness, I have an episode of Doctor Who to watch.
  • Reply 18 of 95
    leafyleafy Posts: 34member
    Quote:
    Originally Posted by Synotic View Post


    Time Machine is based on Subversion? Is there any source for this? I checked Google and the only thing I could find was some guy in 2006 speculating that it uses Subversion.



    I don't believe it uses subversion at all. Time Machine is using the hardlink feature of the HFS+ to provide backups and ref counts of a file unchanged, and save a real copy of the whole file if the file has been changed.



    http://en.wikipedia.org/wiki/Time_Ma...pple_software)
  • Reply 19 of 95
    babiasubabiasu Posts: 12member
    I wish XCode copy Delphi interface
  • Reply 20 of 95
    palegolaspalegolas Posts: 1,276member
    Those yellow folders remind me of another operating system

    I'm no programmer, but it looks like a healthy update to me.
Sign In or Register to comment.