views:

399

answers:

3

Visual Studio tracks cursor positions and lets you move forward and backward through these positions. For example, you can type Ctrl+- to navigate backwards and Ctrl+Shift- to navigate forwards.

I see that XCode tracks the history of which files you've visited, but does it also allow me to go forward and backward through the cursor locations?

The reason I ask is because I find that by using Command-Double left click, I visit function definitions (often in the same file), and then I want to quickly return to where I was previously in the same file. Because I'm in the same file the file history navigation is not useful. Currently I have to search through the code to figure out where I was, which is tedious.

Thanks!

A: 

Not in XCode 3.1.

XCode 3.2 is still under NDA, so we can't discuss its features here, but there are a lot of new features, and you should definitely reinvestigate the question when it comes out.

Rob Napier
A: 

Yes, it does - Command + Alt + .

My XCode is 3.1.2 and it works...almost every time. It you open a new window and start working there it won't go to your previous working window. But if you change files and/or positions in files during your coding in a single window - it'll get you back.

It is called "Go Back" and lives in View menu along with "Go Forward" - Command + Alt + .

For "Go to function definition" the default key binding is Command + F12. In the menu it lives in Edit -> Find -> Jump to Definition

theJonan
I just played with this feature (because you mentioned it). For me it works to activate the file level navigation, but it doesn't appear to track my cursor positions within a file. To see this, open a file, and use the pull down menu to visit a few function and click around all with one file. You'll see that the menu options for this are greyed out. Now visit a new file in the same window, it becomes active in the menu.
Jason Dagit
A: 

jump to definition is not defined by default in xcode 3.1.1 you may set it yourself. go to xcode->preference->key bindings->find->jump to definition

cslxxwilliam