0

I accidentally created two outlets for the same UI element and, after realizing the issue, went on to delete both outlets from the code and the element (a label) that they were attached to.

Now I'm still getting the "The [name of outlet] outlet from the [view controller] to the UILabel is invalid. Outlets cannot be connected to repeating content."

I deleted the code that created the outlet and the element itself with just select+delete. Is there some other way I should have handled it and how can I fix it now?

  • 1
    Have you tried a Clean (`CMD+SHIFT+K`) and Clean Build Folder (`CMD+SHIFT+OPTION+K`)? – Mark Apr 25 '16 at 01:14
  • Just did, The error is still listed in the navigator but not in the overhead error-message. Not sure if that's good or bad or what – Kiernan Hahn Apr 25 '16 at 01:50
  • Have you clicked on the view controller (s) and used the connection inspector to confirm there are no connections you are not expecting there to be? Do so, then clean, delete the derived data, and quit Xcode. – Gruntcakes Apr 25 '16 at 01:55
  • Quitting and restarting Xcode might help. If not, you might be able to fix it by deleting the storyboard and recreating it (unfortunately). Seems like a weird caching issue. – Mark Apr 25 '16 at 01:55
  • I deleted everything in the storyboard and it still showed an error (there were two more like it but they disappeared with the rest of the storyboard). – Kiernan Hahn Apr 25 '16 at 02:00

1 Answers1

0

Delete the outlets that may be causing the problem and control - click on the object in the storyboard and delete all of the connections using the x. Now, go back and reconnect the outlets and everything should work!

If you need help, check this out.

Community
  • 1
  • 1
Dan Levy
  • 3,931
  • 4
  • 28
  • 48
  • I already did. There is no reference anywhere in any of the project that I have seen (swift files and the storyboard) of the outlets. I deleted them along with the ui elements they were associated with. – Kiernan Hahn Apr 25 '16 at 01:35
  • Try what Mark said – Dan Levy Apr 25 '16 at 01:38
  • I'm not convinced you have done what Dan said because you keep saying things like "delete the outlets from the code". You need to delete the outlets within the storyboard using the Connections Inspector. Can you confirm you have done this using the connections inspector. – Gruntcakes Apr 25 '16 at 01:52
  • How do I get to the connection inspector? Google turns up nothing – Kiernan Hahn Apr 25 '16 at 01:58
  • Its the arrow in the top right hand corner https://developer.apple.com/library/ios/recipes/xcode_help-general/Chapters/AbouttheUtilityArea.html – Gruntcakes Apr 25 '16 at 02:00
  • Check out the link in my answer @KiernanHahn – Dan Levy Apr 25 '16 at 02:09
  • So yeah, I already deleted the UI Element so there's no way I can even click on anything that references it. Including the connection inspector – Kiernan Hahn Apr 25 '16 at 02:09
  • Open up the document outline in the storyboard and make sure that you actually deleted the object. – Dan Levy Apr 25 '16 at 02:11