Error in Xcode 6 - view controller does not have an outlet named (subview)

前端 未结 15 2119
刺人心
刺人心 2020-12-03 14:15

I just got this error in one of my apps, and after checking some other apps the same error is happening. None of my IBOutlets and IBActions are con

15条回答
  •  醉酒成梦
    2020-12-03 14:43

    Duplicate of: Xcode 6: can't connect any IBOutlet to ViewController but here's the trick:

    You can also see that the link between the parent view and the custom class is broken (not visible anymore) which is a huge problem.

    I had the exact same issue with the app i'm working on actually, updating Xcode from 5.xxx to 6.1. The workaround that worked for me was to remove the reference of every view controller and re-add them to the project... Unfortunately, in some cases, mine actually, all the connections get lost again when XCode is closed.

    To everyone facing that issue, here's the (annoying) trick :

    • Step 1 : select both .h and .m view controller files
    • Step 2 : remove the reference of those files
    • Step 3 : re-add the files to your project tree
    • Step 4 : open the storyboard, eventually re-build the project and smile

    I can understand those things could be reaaally annoying, but it worked for me... Hope it will help someone else !

提交回复
热议问题