Unrecoverable Outlets and Actions in Xcode 8/Swift 3?

Thru some bug(s) in Xcode 8.3.1, the connection for @IBActions/@IBOutlets get dropped. If my memory is correct, this happens to all of them in one view controller. When this happens, I can't delete and re-connect them unless I re-create the swift file and delete original. This is a real pain in the a__, especially since I didn't cause the problem.


My question is: What can I do to recover from these dropped and non-replaceable outletts/actions without creating a new/replaced swift file?

Answered by Claude31 in 212986022

My point was :

- when you select the JVC in the mainStoryboard, does the identity inspector show JVC as customClass ?

- in some cases, when it is impossible to create the connection by dragging from the white bullet in swift code to the object in IB, it is possible to ctrl drag from the object in IB to the IBOutlet (on the var nameOfOutlet part) or inside the code of IBAction

Of course you tried to do a complete clean (option clean of the Project) ?

Yes. Every time it happens, but to no avail.

Claude, here is a screen shot of the alert I get when I try to create an outlet:

you know screen shot do not appear on this fantastic forum tool !

Claude, I know this is true, but when I pasted it and it showed, I thought maybe the apple forum was finally coming of age. Compared to Microsoft, this forum *****, but I don't want to work with Windows/Visual Studio any more.


How can I send y'all a snapshot, because "a picture is worth a thousand words"." The message in the alert is: "Could not insert new outlet connection: Could not find any information for the class named JobViewController "

Usually by posting on gitHub.


Are you sure the fileowner of the xib is of appropriate class (JobViewController)

Claude, I'm not sure what you mean by or how to tell: Are you sure the fileowner of the xib is of appropriate class (JobViewController? This app's heirarchy is: ViewController -> JobViewController (other VCs, at this level, will be added after I get this one working.) So far, I've been doing all my coding in JVC. I've had this problem, dropped outlets/actions, several times in the past, and the only way i've been able to recover is to delete and re-create the view controller in storyboard and its associated swift file.


This is a serious bug/flaw in Xcode, because there is no way I should be able to drop these outlets/actions without expressley deleting them. And, in the event I delete one or more of them, I should be able to recreate it.


Regardless of all of this, there should be a way to get to the attribute or connection item and switch it off or on. What do I need to tell you to help you or your cohorts resolve my problem?

Accepted Answer

My point was :

- when you select the JVC in the mainStoryboard, does the identity inspector show JVC as customClass ?

- in some cases, when it is impossible to create the connection by dragging from the white bullet in swift code to the object in IB, it is possible to ctrl drag from the object in IB to the IBOutlet (on the var nameOfOutlet part) or inside the code of IBAction

Yes, it shows the correct VC's name, and your second point (in some cases .......) doesn't work either.


Claude, I don't want to drop this thread, because I know it will happen again! So, please get any help you need to resolve it. I'm always willing to provide any additional infor you request to assist you. In the mean time, I'm recreating the VC and swift file which is a pain in the ----. Terry

still trying to imagine what's going on.


when you right click on the object in IB, do you see any connection active ?

Unrecoverable Outlets and Actions in Xcode 8/Swift 3?
 
 
Q