tags:

views:

183

answers:

1

Xcode has a feature which allows you to quickly switch between a {.m,.c,.cpp} file and its corresponding header file (e.g. .h). You can do it from the menu by View > "Switch to header/source file", or by the key stroke ⌥⌘↑ (alt-command-up_arrow).

Either way you do it, mine is broken, and mostly nothing happens. The View menu does briefly highlight when I do the key stroke. Why? How do I fix it?

+2  A: 

Short answer: the external editor setting and file type associations screwed this up.

Xcode uses the file type association to determine what to fire off when this command is invoked. Mine were attached to an external editor, MacVim, which I love. Sadly, in my experience, this Xcode external editor business didn't play well with MacVim. And then it screwed this up. Sigh.

How to unset:

  1. Open Xcode Preferences (⌘,)
  2. Click "File Types" tab.
  3. Under file / text / sourcecode / sourcecode.c / *, make sure all entries are set to "Default (Source Code File)".

Bonus, if you don't want this command to spawn another window:

  1. Click the "General" tab.
  2. Select "Open counterparts in same editor".
Clay Bridges