Xcode tips


If you’ve discovered some useful Xcode feature, how about posting it here?

Here’s one that I find useful:

Moving around a file:
Once your files start getting really long, it can be hard to locate methods in the file. At the top of the code editor, there is a “jump bar”, which looks like a horizontal listing of nested directories. If you click on the last entry, a drop down menu will appear, which will show you all the methods in the file(marked with an M) and all the properties(marked with a P). You can click on those names, which will jump to that spot in the file.

Furthermore, if you put comments in your code like this:

The text “Some Heading” will appear in the drop down list in bolded text, followed by the methods in the code that come after that comment. That allows you to organize your code even further into, for example, categories such as these:



Custom Methods:

MKMapView Delegate Methods:[/code]


Here’s another one:

In Xcode, if you hit Command+T you will get another tabbed window. You can set up one tab window to show only the main.storyboard with the table of contents on the left–giving you lots of room; and you can set up another tab to show just a ViewController with the project directory on the left–also giving you lots of room. I find it’s much easier to work on a project by switching between tabbed windows setup like that, than working within a single window and constantly sliding panes in or out from the left or right to get the desired space.