Xcode 4 Transition Guide
Link: [Sign in to your iOS Developer account] > iOS Dev Center > iOS Developer Library > Resource Types > Guides
These are notes based on the Xcode 4 Transition Guide (page numbers refer to the PDF) that I found helpful to me. This guide gives you an overview of the many refinements made during the transition from Xcode 3 to 4. Well worth a look if you are not using Xcode 4 regularly and would like to know more about its features. The following notes are of particular interest to me; you’ll find much more in the document than what I’ve written.
Xcode Workspace window, p 11
Gives you the names and locations of key parts of the Xcode window.
Fix-it, p 33
I liked how Eclipse pointed out my syntax mistakes in coding and offered to fix them for me. Now Xcode 4 has this feature, too!
Better Searching, p 38
If I set up a workspace” and initiate a search, Find will search all occurrences throughout the whole workspace. Luckily, the search can be fine-tuned by clicking on the magnifying glass in the search pane at left.
Help in Xcode, p 48
Don’t neglect the help files in Xcode 4. Many will include videos to show you how it’s done. Under iOS 5.0 Library > General, I found version “Diffs” that show me what code changed from one version to another, deprecated or added. This will help me to upgrade my older code and bring it up to standards. This help section is so thorough, I’ll look here first for any answers before going online. I noticed that when I first attempted to access the help files, Xcode crashed. When I opened it again, it informed me that it needed to download the iOS 5 files. After that, I was able to start using the help files. It looks like all the docs online are right here, including code samples. (Help > Xcode Help.)
Application Loader replaced by Archive/Organizer, p 50, 101
When you are ready to Upload Binary, you would choose Product > Archive to compile the app, then select the app in Window > Organizer to validate and submit the app to the App Store for review.
Code Snippets, p 58
You can create and drag onto your code page snippets of reusable code. Write out the code in your source file, highlight it, and drag it into theCode Snippet library pane. I can drag anything there, including the JQuery-Moblile page template (from <div data-role=”page” … to </div><!– /ooter –></div><!– /page –>), any any other code I’ll use repeatedly. This will be a huge time-saver. (View > Utilities > Show Code Snippet Library)
Media Files, p 58
Also a time-saver (located with the Code Snippets) is the Media Files pane. When you select it, you’ll see a thumbnail of the media associated with your project. You can drag the thumbnail to the place in the code where the image belongs, then add the <img> tags to it. (View > Utilities > Show Media Library).
Creating UIs in Xcode 4, p 62
Interface Builder is integrated into Xcode. Connections are easier to make to the classes with drag-and-drop ease. YOur UI is in one pane and code shown in another pane. You drag directly between the two to make IBoutlets, for example.
Refactoring, p 87
I finally learned what refactoring your code means. “It improves the structure of source code without changing its behavior.” This applies only to C and Obj-C files.
Snapshots, p 91
When I created a snapshot of my work in Xcode 3, then reverted to the snapshot, it overwrote the app. In Xcode4 , it saves the snapshot in a user-named folder. You can revert to that snapshot, but let Xcode save the current session to a snapshot so you have both versions. You manage your snapshots in Organizer.
Git Version Control p 94
You can save your files to Git and Git will monitor version control. You need to manually “commit” your changes to the repository to make them effective. With this feature you’ll be able to compare different versions of a file side by side in Xcode 4. (File > Source Control > Commit)
While in the iOS Developer Library, I recommend checking out Xcode New Features User Guide to learn more, including a Storyboard feature (p 16) that lets you map out all the screen transitions throughout your app in the Interface Builder module — graphically. Cool.