44

I've been using Xcode 4.3.1 since it came out now and I've worked on many different projects since. Everything has always worked fine until this new project I'm working on.

The code completion/code sense never finds anything. When I 'Command+Click' a variable or class normally it would jump to that but now I'm just getting:

Symbol Not Found

The Jump to Definition action is not working.

If I open one of my older project while this bad one is open, the old ones still work for code sense and the new one doesn't.

My partner is working on the same project, we both get the files from our repository and the code sense works on his machine for this project...just not mine.

pkamb
  • 33,281
  • 23
  • 160
  • 191
rob1302
  • 1,631
  • 3
  • 15
  • 18
  • Not a fix in any way, but for me, if the method I was clicking on had 3 argumentNames...clicking on arugmentName1 was **stiill** working. However clicking on arugmentName2,3 didn't do anything. Try that and comment if you get around with it in the sam way I mentioned – mfaani Jan 11 '17 at 19:20

10 Answers10

71

Try this:

Open the organizer. Close your project in Xcode (leaving Xcode and the organizer running). In the organizer, in projects, click on the Delete button next to Derived Data. Quit Xcode.

Find your Xcode project via the finder. Rightclick and "Show Package Contents". Delete project.xcworkspace and xcuserdata folder.

Open up Xcode again and see if that works for you.

g_low
  • 2,435
  • 19
  • 23
  • Thanks! This seems to have worked..I deleted the 'Derived Data'..delete my entire project folder and re downloaded it from my SVN and now it's worked. I've rebooted several times and close/opened Xcode a bunch since doing this and it's still always working :) – rob1302 Apr 25 '12 at 20:46
  • I was having a problem with the "Jump to Definition" giving me the "Symbol Not Found" error even though it was working before. Doing what you said fixed the problem. Thanks! – BlueVoid Jul 13 '12 at 21:55
  • thanks this was driving me crazy. fyi i only did "delete derived data" part and it started working again. – groffhibbitz Aug 07 '12 at 00:58
  • 2
    WARNING: note that this deletes your schemes – Claudiu Sep 27 '13 at 19:07
  • 1
    For xcode 6 and above xcode > window > projects - to delete derived data. I also did not delete the xcworkspace. That seems like a bit much. – Alberto Lopez Apr 14 '16 at 16:37
  • Thanks, this still helps for xcode 12.3, I was coping files and folders from an old project to a new one and drag&drop to create reference in the new project. The project complies but the cmd+click was stuck and loading forever. I cleaned my derived data and user data. Problem solved. – infinity_coding7 Jan 11 '21 at 16:58
23

With Xcode 8.2 I solved in this way:

  1. File > Workspace Settings
  2. Click over the little grey arrow above Advanced... Button (Derived Data)
  3. Select my project folder and delete it.

Now in your project see if cmd+click works

Jorge Casariego
  • 21,948
  • 6
  • 90
  • 97
5

Similar issues with Xcode 8 and Swift 3.

Just quitting the Xcode and Simulator, reopening the project worked.

Other times, Restarting the Mac gets rid of question mark and does navigate to relevant method implementations

And at times, simply closing the project and opening it again from 'File -> Open Recent' also works.

pkamb
  • 33,281
  • 23
  • 160
  • 191
Naishta
  • 11,885
  • 4
  • 72
  • 54
2

In my case I solved in this way.

  • Go to Project's propreties from Project navigator.
  • Build Phases
  • Add your *.m files in "Compile Sources"

Now re-build.

This could be happen, for instance, when your manually rename a class after its creations.

Hope this help.

Luca Davanzo
  • 21,000
  • 15
  • 120
  • 146
2

Xcode 10.2.1 - simply closing Xcode entirely and reopening it solved it for me.

Dick Thunder
  • 378
  • 3
  • 17
1

For others if none of the above mentioned methods worked try this :

Go to menu bar Xcode - > Preferences -> Locations -> Command Line Tools

Choose proper (current) Xcode format here.

iPhoneDeveloper
  • 958
  • 1
  • 14
  • 23
0

In my case, .m file was somehow located in en.lproj directory and that prevented it from being shown properly with syntax coloring and intellisense on.

In the File inspector side panel check if there is something checked in Localization tab.

Alex
  • 2,468
  • 1
  • 20
  • 16
0

I had this problem, restarted, quit Xcode, nothing happened. Switched to master branch, pulled, checkout into new branch. Problem Gone. I even went back to my previous branch and all was working. My only guess is that git messes up sometimes!

mfaani
  • 33,269
  • 19
  • 164
  • 293
0

3 reasons this happens :

  1. Corrupt derived data : Solution : clean derived data folder.

  2. Corrupt project settings : Project.xcodeproject -> Right Click and clean the files mentioned in g_low's answer.

  3. File not a part of project target : Check if the file is a part of compile source and if not add it...

Mike Akers
  • 12,039
  • 14
  • 58
  • 71
0

I was having a similar issue, and found that when the View Initializer is in Live Preview, command clicking a preview element doesn't open the structured menu. However, when pausing Live Preview, the view initializer becomes responsive to command clicking - i.e. the structured menu appears.