1

So I have this weird Problem where I have 4 UIButtons in my App not working at all, even though i have double checked on having them correctly linked to the Storyboard. So i tried to disconnect and reconnect them but the icon indicating that its linked didn´t disappear. So I checked what else the function is linked to and it seems somehow it got linked to the main.storyboard, and i guess for that reason, these are the only ones not working.This is how it looks like

So I tried to disconnect it from Main.storyboard, but to no success so far. How can I remove a connection to the storyboard as sender and why does it appear in the first place?

Ali Ihsan URAL
  • 1,894
  • 1
  • 20
  • 43
  • Have you tried to remove it from connection inspector? – iosdev Oct 15 '18 at 12:22
  • I have tried to disconnect it from the link- Button within the Code and have disconnected it via Inspector from the Buttons, but the main.storyboard doesn´t seem to have one. Or atleast i can´t locate where to find the connections of main.storyboard – Philip Wald Oct 15 '18 at 12:33
  • Go to the storyboard, and select the view controller-- you can see all the connections there – AMayes Oct 15 '18 at 16:52

3 Answers3

5

I too did it accidentally for a button.

Connected a correct segue to the button and accidentally connected one more to a UICollectionView and I was getting this :

enter image description here

Checked the storyboard on right clicking the button :

enter image description here

and found the two outlet connected. Removed it on clicking the cross icon and it worked.

If you click on the connection showing in UIViecontroller it will not redirect here.

you can also check all the connected referencing outlets here:

enter image description here

Amit
  • 4,837
  • 5
  • 31
  • 46
  • That exactly what i was looking for, just the other way around, it´s weirdly the function that connected to the Storyboard instead of the Button, and i can´t find this exact window for the storyboard. If you know where to locate that window fitting for a storyboards links i´d be grateful – Philip Wald Oct 15 '18 at 12:52
  • I didn't get what exactly you are asking for. I have updated the answer for more reference to check referencing outlets on a button. – Amit Oct 15 '18 at 13:38
1

So i fixed the Problem by copying the code to another file and only "rewriting" the functions that were linked to the given problem. All i could find to this problem was some old answer that explained that the link referrs to a ViewController that the Code originates from: https://stackoverflow.com/a/37324993/10160115 Even though the Code i wrote is not copied it seems that XCode has created exactly such a referral to the storyboard it was linked to, so it linked the function to itself but couldn´t find any Button to link it to so it just linked it to nothingness. It fixed the problem and the buttons work the way they´re supposed to be now but it´s a weird way of fixing this, but since there seems to be no connections inspector for the storyboard itself i wouldn´t know how else to fix this

0

To solve this problem you should (for macOS Catalina 10.15.4, Xcode Version 11.1):

  1. Close your project and close Xcode
  2. Open /Users/XXXXX/Library/Developer/Xcode/DerivedData and delete your cache of project
  3. Open /Users/ХХХХХ /Library/Developer/Xcode/DerivedData/ModuleCache.noindex and delete all cache from this directory
  4. Open your project again and click Product > Build
Roman
  • 1,045
  • 1
  • 12
  • 33