问题描述
我已将一些源代码从一个旧 xcode项目复制并粘贴到另一个新项目.
I have copied and pasted some source code from one old xcode-project to another new project.
复制的代码中包含一些@IBOutlets和@IBActions.我的意图是稍后将它们连接到新项目的情节提要中.但是,xcode以某种方式设法将引用复制到旧项目的情节提要中.如何摆脱这些引用?
Included in the copied code where some @IBOutlets and @IBActions. My intention was to later on hook them up to the storyboard in the new project. However, xcode somehow managed to copy the references to the old project's storyboard. How can I get rid of those references?
更新:添加了我的情节提要与buyButton的连接后,xcode表示buyButton已连接到两个不同的情节提要.
Update: After having added a connection from my storyboard to the buyButton, xcode indicates that the buyButton is connected to two different storyboards.
推荐答案
我目前的结论是 xcode (7.3.1)包含 bug (或缺点).
My current conclusion is that xcode (7.3.1) contains a bug (or shortcoming).
如果我终止xcode然后打开我的新项目,那么一切看起来都会很好.
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.
我的猜测是,xcode会扫描所有项目中当前打开的所有情节提要,以找到出口名称(例如"buyButton")与故事板.
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.
这篇关于@IBOutlet和@IBAction引用错误的项目,如何摆脱那些引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!