A few minutes ago I was watching someone in IRC try to figure out how to do something and I came to the realization that while they were really bright, the new Xcode environment was so foreign to them they didn’t really know where to look to find information.
With that in mind I offer these quick tips:
1. Xcode comes with all the documentation for pretty much everything you need to write code for Mac OSX and Mobile OSX.
It is hidden under the Help menu, which 99% of OSX apps have, and is ignored by every OSX user, because only 1-2% of them actually have any useful help in them.

The documentation is vast. I hesitate to guess that printed it would be 20-30 feet across on a shelf. That leads to hint #2
2. You can hold down the option key and double click any function or method and jump immediately to the matching documentation.
For instance if I option double click on NSLog in this code fragment.

This comes up in the documentation window. Notices that NSLogv is a hyperlink to the documentation on that function.

3. If you are the kind of person that find a quicker answer in header files, cmd-double click to go to the header file that defines the function or method.
This also works with your source code as well. If you have a method called doTheThing: and you can’t remember if it takes a string or int as you are typing code to call dotheThing, just command double click and you will go to the method in your code. You can then go back to where you came from with the Go back short cut, Command option left.
4.There are a ton of keyboard shortcuts, and you can change them.
You can find most of them in the xcode preferences panel under KeyBindings. A lot of them are based on emacs key bindings.

With just 20 or 30 key bindings you can pretty much navigate your entire project, build, run, and test without ever taking your hands off the keyboard.
5. While debugging you can hover over a variable to see the value.
Here you can see I’ve set a break point on line 175 (the blue marker), and that the program has stopped there (the red arrow indicating the current program counter). By just placing the mouse over favorites and waiting for a second, I’m treated to the information that it is supposed to be a NSMutableArray called favorites, and that it is currently a nil pointer and therefore has zero objects.
xxxxxxxxxxxxxxx
The second time through I find that it has now been created, is actually a NSCFArray, and has seven objects.

6. Xcode is based on standard open source tools
Under the hood Xcode uses GCC for most compiles, and GDB for the debugging. So if you know or can find a book about gdb or gcc or a web site about them you will be able to do amazing and clever things. On top of that advanced features used for performance tracing use dtrace, also open source and also with a large support community.
This also means when you find a problem in Xcode, you can go down to the command line and duplicate or work around the problem. For instance I have an executable that Xcode never will play nicely with when I’m debugging. So I can debug the same app from the command line using GDB.
7. Research Assistant
Research Assistant is not as well polished as other parts of Xcode because it is relatively new. Like the documentation, you find it under the help menu. Leave it open and as you type it will show a quick documentation snippet for the code to the left of the insertion point.

It updates live as you type, showing not only the arguments, but also providing hyper links to them, and showing sample code that uses the class, function or method:

I find it a bit too slow updating and unreliable for my tastes, but for a beginner it can be very useful.
8. You can move things around in condensed mode
I tend to run Xcode in condensed mode and found myself getting pretty frustrated having to move between Files, Targets and Other.


Quite by accident I discovered that you can move things between them. To switch sections while dragging just drag over the tab:

You can use the same trick to drag files from the project to particular build phase of a target using this method as well.
9. Code Completion on demand
One developer I worked with thought the only way to get code completion to work was the settings in the Code Sense pane of the preferences tab. He was constantly tweaking the delay setting up and down depending on the code he was working on.
If you need code completion NOW, and don’t want to wait the 2-3 seconds for the popup, you can use these key bindings:

10. [Withheld]
I had a tenth tip, but I didn’t think it all that great. So I have withheld it for a future post. In the mean time, send me any more tips you have and I’ll collect them and post the best.
