@IBOutlet and @IBAction refers to wrong project, how to get rid of those references?

前端 未结 7 1987
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-20 02:44

I have copied and pasted some source code from one old xcode-project to another new project.

Included in the copied code where some @IB

相关标签:
7条回答
  • 2021-02-20 03:10

    My current conclusion is that xcode (7.3.1) contains a bug (or shortcoming).

    If I terminate xcode and then open my new project then everything looks good.

    If I then open the old project, and also open the old storyboard within that project, then the false bullet links becomes visible in my new project.

    My guess is that xcode scans through all storyboards, that are currently opened in any project, to find a link between an outlet name such as "buyButton" and a storyboard.

    0 讨论(0)
  • 2021-02-20 03:12

    Just Change one letter from name it cause to break relationship to storyboard and link it again to new storyboard, I hope it help you.

    0 讨论(0)
  • 2021-02-20 03:13

    This is still an issue with Xcode 8.3.3 as of June 25th, 2017.

    The only solution I have been successful with is to change the name of the entity.

    What doesn't work for me:

    • Clean, clean project build folder

    • Restart Xcode

    • Upgrade Xcode to newest version (existed in 8.1 and 8.2 for me as well)
    • Close the other project that I had open
    • Delete and re-add the connection
    • Inspect the source code and remove the duplicate connection from the xml
    • Click any of the places to view references, delete them, and re-add.
    0 讨论(0)
  • 2021-02-20 03:32

    Try this:-

    Click on the Outlet dot

    click on the Main.Storyboard where it will Lead you

    Click on the View Controller and you'll see Your outlet Connected

    Remove the connection by clicking on the Close button and you're ready to go.

    0 讨论(0)
  • 2021-02-20 03:33

    For me solved after restarting the Xcode . Now its working fine.

    0 讨论(0)
  • 2021-02-20 03:34

    Finally came up with another solution We can also remove connections from Storybord by the following steps:-

    Find Your connection and remove it:-

    0 讨论(0)
提交回复
热议问题