Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode 7.3: Could not insert new outlet connection and deleting DerivedData doesnt work

Tags:

xcode

ios

swift

the most common answer for this question on SO is 3 years old and the commonly agreed solution (delete DerivedData) doesn't work for me so I have to re ask this question.

this is the problem i have, optically looks the same

I am trying to drag to create an outlet for my tableview.

as mentioned, deleting DerivedData does nothing for me (but I can see it reindexing). The second most common answer is

Removing(removing reference, not deleting) and then adding the appropriate file(the file of class you want to add the outlet to) is actually enough.

Edit 1 I found that after unchecking (in XCode 6.3.1) I had to wait a few seconds for the Indexing to appear and complete in the project name box. Same for the way backwards. This increased chances to fix the issue in almost all (but not all) cases.

Edit 2 Removing reference means that You do not delete the file completely but just remove it from the project (it still exist in the folder of your project, you add it later).

I dont know if this still applies to Xcode 7.3 since I work on storyboard and don't have any .h or .m files to delete or remove references to. If this advice is still valid in xcode 7.3, could you please advise where to click?

Other things I have tried that did not work

  • cleaning project
  • restarting xcode
  • in Terminal: defaults delete com.apple.dt.Xcode
  • in Terminal: defaults write com.apple.dt.XCode IDEIndexDisable 0
  • rewriting the entire project from scratch

Help a brother out?

like image 741
swyx Avatar asked Jun 08 '16 06:06

swyx


People also ask

How do I delete an outlet in Xcode?

Right click the view name in the Document Outline. Then click the little x by the referencing outlet. Select the view on the storyboard and then click the Connections Inspector. Then you can click the little x to remove an outlet reference.


1 Answers

Hi future xcode n00bs (i hate when the loop isnt closed by the asker!), please refer to @Paulw11's comment. that fixed it for me

You can just create the IBOutlet manually and then in IB drag from "new referencing outlet" to your view controller object in the left hand panel (you will need to expand this panel first, from your screenshot it is currently hidden) and make the connection. The assistant view is often a bit flakey

like image 100
swyx Avatar answered Sep 27 '22 17:09

swyx