I have two XCode Projects in the same directory using very similar names. I've noticed when creating an IBOutlet in one project with the same name as another IBOutlet in the second project that the IBOutlet links and refers to both storyboards. Now this bothers me and I would like to know how to fix this issue so that it only references its current project storyboard.
2 Answers
I have two XCode Projects in the same directory
In the very very same directory? That could spell trouble, since a project references its files using relative references. One project per project folder, please!
EDIT: That answer turned out to be totally bogus. In reality, this was just one of those temporary Xcode epiphenomena. Cleaning out the Derived Data folder fixed it, as described here:
-
So there's a top level directory called XX and then within that directory there are two more folders, Project1 and Project 2. Is that a problem? – David Apr 16 '13 at 21:15
-
No! After all, all my projects are in a folder called dev. – matt Apr 16 '13 at 21:16
-
So is there a way to resolve my issue? It bothers me that it links to two storyboards. Should I simply just use different variable names? I think that it's silly that I can't use the same name without referencing two storyboards. – David Apr 16 '13 at 21:17
-
Example `dev/myProject1/myProject1.xcodeproj/`, along with `dev/myProject1/myProject1`; `dev/myProject2/myProject2.xcodeproj/`, along with `dev/myProject2/myProject1` - no problem – matt Apr 16 '13 at 21:18
-
Can you prove that one outlet is referencing two storyboards? That should be impossible – matt Apr 16 '13 at 21:18
-
You didn't drag a storyboard from one project into the other and forget to ask for a copy, did you? – matt Apr 16 '13 at 21:19
-
Also projects don't usually have any outlets *to* storyboards, so it's a little unclear what you're seeing here (but maybe when you say "outlet" you just mean "reference" - outlet is a technical term that you might be using incorrectly?) – matt Apr 16 '13 at 21:20
-
1Nope, I am trying to connect a UIImageView from the storyboard to its respective UIViewController class in Project1. Upon making the connection with the same variable name as another IBOutlet in Project2, I see a black circle dot next to the line number. I click it and it links me to the storyboards in Project1 and Project2. However, when I go to the storyboard in Project1, there is only one Referencing Outlet. Perhaps, I misunderstood and XCode is just telling me that there are more than one instance where I have a IBOutlet with the same name? Or maybe the IBOutlet is linked twice? – David Apr 16 '13 at 21:26
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/28336/discussion-between-matt-and-david) – matt Apr 16 '13 at 21:28
-
Seeing the exact same behavior as described by @David – Scooter Feb 20 '17 at 01:09
I see the exact same issue. It has been there since I started with Xcode 4 and still present in Xcode 6.
It comes up when I copy a controller file to a new project AND I have both projects open at the same time. An outlet appears to be connected to both storyboards.
Cleaning out the Derived Data folder and the contents of /var/folders does not fix this for me. Neither does restarting Xcode. I also tried renaming the Storyboard in one of the projects to no avail.
The only solution I found was to make sure that controllers were uniquely named. This can be easily done by using a unique project prefix. I suppose that uniquely naming outlets would also fix this, but that is much more difficult to keep track of.

- 1,254
- 9
- 16