48
votes

Xcode storyboard assistant editor stopped showing related files. "Automatic" is selected and "Class" is filled in Identity Inspector.

It was working before, but know it has stopped. "Auto" or "CounterPart" modes are still woking for other files except StoryBoard.

A few days ago, I tried to update from Xcode 5 to 6, but later on gave up. Would that have something to do with it?

17
have the same problem too with xCode 6.2 beta. - ChaosSpeeder
same problem here, could you find a solution? - Anna-Chiara Bellini
I have seen what could be a solution at the video youtube.com/watch?v=wPAUKhlmW1M at time-position 1:31 - please correct if I'm wrong - Valter Ekholm
why is this such a common and simple issue and yet there's no definitive answer to it - Kevvv
In my case, I deleted the Derived Folder as mentioned below and selected the Custom Class in Identity Inspector. Hope this helps, Thanks. - Amit Khetan

17 Answers

66
votes

Found the solution (at least worked for me), it's the same bug that causes you not to be able to create new outlets. You must delete the [DerivedData] folder:

  1. Close the project you are working on with.
  2. Delete the【DerivedData】folder of you project. (This folder may inside your project's folder, or inside ~/Library/Developer/XCode/DerivedData/(your project)/ ) or somewhere else that were setup by you.
  3. Restart Xcode.

see here.

46
votes

With XCode 11 onwards, you can option(alt) + click on the file that you want to view in assistant editor. Simple Fix.

13
votes

In same case this worked for me:

  1. Right click on ViewController file(on left pane) and choose Delete -> Remove Reference.
  2. Right click on folder where this ViewController file was and choose Add files to .. and add this ViewController file which your just deleted.
  3. Profit.
8
votes

Deleting the Derived Data didn't work for me nor force quitting Xcode and restarting it.

The only thing that worked was deleting both the class and the storyboard (only the reference to them) and adding them back to the project.

Hope to help someone.

5
votes

Maybe it's too late but just with the keyboard, you can launch a reset for associated files. Use the keyboard : command + option + shift + z

You can find it in the menu Xcode->View->Assistant Editor->Reset Editor.

5
votes

If anyone is wondering how to find Assistant editor in XCode 11 then please find the steps from the below image. You can show this options in storyboard or Xib files on upper left corner.

enter image description here

3
votes

Click first on the assistant window, then click on 'option'+'alt' and right click on the view controller that you want.

2
votes

This command on terminal fixed my issue:

    defaults write com.apple.dt.XCode IDEIndexDisable 0
1
votes

For Xcode 8+ versions

Check at top process indicator that if Xcode is "indexing" files... if yes, then, please wait until it finishes. Once it get finished. Your file will automatically appear as counterpart in Automatic section.

If Xcode is not showing "indexing" in process bar, then perform as @Anna Chiara's Answer

1
votes
  • I deleted ~/Library/Developer/XCode/DerivedData -> didn't work
  • Xcode->View->Assistant Editor->Reset Editor is disable

Finally, I figured out that the class name of File's Owner of .xib file is incorrect (the class doesn't exist). I corrected it and Assistant Editor works again.

Hope this helps you

1
votes

I had the same problem. Finally this is what worked for me.

  1. Changing the name of the ViewController File.
  2. Change the name of the class to the new name via the Refactor tool

Refactor tool

1
votes

The only thing that ended up working for me was copying over the code from the offending ViewController files and completely deleting them, then creating new ones with the exact same name and pasting in the previous code.

The assistant then linked up to the new ViewController files with no issue.

0
votes

I had same issue and spent almost 2 hours of trying different aproaches finally I found something to solve problem.

I've created two or more VC at the same swift file and I think that's why IDE confused about the files. So I suggest that you should delete your viewcontroller class and clean than reassign class.

I hope it works for you too.

0
votes

For what it is worth, this was happening to me for the last couple days on 9.3 . I had just added a new build schema for an alternate debug symbol on testflight. It was not until I removed the new schema and then deleted Derived Data and restarted did it start working again. I have re-added the new schema back in and it continues to work. Not sure what the issue was, but that is what solved it for me.

0
votes

In case anyone is watching I had a bizarre instance of this (Xcode 11): I deleted a View Controller that I'd done incorrectly; dropped in a new one, created the UIView and associated. BUT I didn't bother to create the outlet from the View Controller on the previous screen. Strange that it let me work for a few minutes, then after I had turned off the assistant editor to do something else, turned it back on and only had the UIResponder.h file. Edit - this happened again. Had to delete the 'wire' to the next screen, then recreate - then option to get to the correct .m and .h files reappeared.

0
votes

simply exiting and reopening Xcode worked for me.

-1
votes

Fixed by restarting - Xcode 12.5