19

I always have my Xcode assistant editor open with counterparts option. It's very handy to have an *.m file opened at standard editor while having corresponding *.h file in assistant editor.

After recent update to version 6.3 Xcode started to show random instead of corresponding headers quite often. Several clicks to "four squares" icon and mode usually brings it back (but it's very annoying).

Do you experience this too? How to fix it?

Note: deleting DerivedData didn't helped

Alexander Vasenin
  • 11,437
  • 4
  • 42
  • 70
  • This is driving me crazy too. Any luck? – BFeher Apr 17 '15 at 02:25
  • 2
    The only thing I found so far is to minimize number of clicks to return back to "Counterparts". If you see "Manual" item - click on it and select "Counterparts" (2 clicks). If you don't see "Manual", which happens quite often for me, click on file name twice - it reveal "Manual", than click on "Manual" and select "Counterparts" (4 clicks total). – Alexander Vasenin Apr 17 '15 at 16:17
  • It is far from clear what sort of answer would satisfy this question. You're just complaining that you've found a bug. I've found bugs in Xcode 6.3 too. File a bug report and move on. This is not appropriate for Stack Overflow, because there is no possible answer (because it isn't really a question). – matt Apr 17 '15 at 16:26
  • @matt First, I'm not sure if it's really a bug (look for a keyword counterpart in Xcode 6.3 keyboard shortcuts), second there might be a workaround – Alexander Vasenin Apr 17 '15 at 16:40
  • 1
    Driving me crazy as well, and also causing me to edit the wrong file. I'm so used to seeing the .h on the right when I open the .m that it is throwing me off. – Andrew Smith Apr 17 '15 at 22:47
  • I hope they fix this soon. – livingtech Apr 28 '15 at 19:24

2 Answers2

9

As a workaround, one could use the Reset Editor command with the keyboard shortcut Command+Option+Shift+Z (US keyboard layout). If your keyboard layout doesn't match, you can see the key binding in View->Assistant Editor->Reset Editor. A word of caution, though, this will close any additional Assistant Editors you may have opened (the ones that open by clicking "+").

Another thing I noticed is the bug happens when you are switching Xcode windows or tabs but not when you are switching files within the same tab.

Joel Murphy
  • 845
  • 1
  • 6
  • 13
  • 1
    This doesn't work for me. Not sure why, but under the menu `Reset Editor` is grayed out for me. – livingtech Apr 28 '15 at 19:27
  • The only condition I can get the command grayed out is when the Assistant Editor isn't opened. When the assistant editor is opened, the icon looking like two circles, in the upper right corner, should be highlighted. If the two opposing arrows are highlighted, that is the Version Editor and the reset won't work. – Joel Murphy Apr 29 '15 at 19:17
8

It looks like it's a just bug after all. I filed a bug report rdar://20684654. For a workaround see the accepted answer.

UPDATE: it's fixed in Xcode 6.4 beta

Alexander Vasenin
  • 11,437
  • 4
  • 42
  • 70