Clicking on issue in Issue Navigator not jumping to issue in code

I somehow managed to break my project so that clicking on an issue in Issue Navigator does not jump to issue in code unless I first build the project.

Does anybody have any ideas on what to fix in my project so that it works again as it is supposed to?

Accepted Reply

This thread has been deleted

>> Would deleting ModuleCache resolve the issue?


I don't know. If these sources are in a framework target, I'd be more inclined to think it might. If they're in the main app target, then probably not, although the app target is a module, too.


However, it looks like the problem is stale file references. Try this first:


1. In the build phase, select all the source files that say "in OldName".


2. Right-click on the selection and choose "Show in navigator".


3. Display the File inspector.


4. Uncheck the target membership for the files, then check it again. The files should disappear from the build phase when you uncheck, and re-appear when you re-check.


That may solve the problem. If not, try this:


1. In the project navigator, select one of the source files that still shows as "in OldName" in the build phase. (You'll need to fix them all eventually, but start with one to see whether the following procedure helps.)


2. Show the File inspector, and look at the location menu. It should say "Relative to group". (In most cases, for source files.)


3. If it doesn't, choose "Relative to group" from the popup. Depending on what's going on, the file may turn red in the navigator, indicating that its path information no longer locates it. That's OK ...


4. Select the group containing the file in the navigator. Click the tiny folder icon under its Location popup. Navigate to and select the folder that contains the source files in that group, and click Choose.


That should fix the reference to the file, so that it no longer appear incorrectly in the build phase. If you're lucky, it will fix everything in the group.


Note that if multiple files have the same problem, you should be able to select them all and fix their Location settings all in one step. Also, since groups may be hierarchical, you may have to correct things at multiple levels. Luckily, the current Xcode is pretty tolerant. If you accidentally choose the wrong thing, the files may turn red, but they'll go back to black when you fix the problem. (In the old days, the items would be unfixable, or would disappear.)


The overall strategy you typically want for source files is for them to be relative to their group, and for their group to point at the containing folder.

Replies

What version Xcode on which macOS?