XCode 自定义 segue 类卡住了

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10687726/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:22:52  来源:igfitidea点击:

XCode custom segue class stuck

iosxcodeuistoryboarduistoryboardsegue

提问by Ostmeistro

this question might seem a little weird, but I can't wrap my head around why this is happening.

这个问题可能看起来有点奇怪,但我无法理解为什么会发生这种情况。

What I did was I renamed a custom segue class, and reflected it in the storyboard under 'custom class', but it still tries to call the old one.

我所做的是我重命名了一个自定义 segue 类,并将它反映在“自定义类”下的故事板中,但它仍然试图调用旧的。

I have cleaned the build folder and searched the project for the old custom class name and it does not find anything in xcode at least. I look inside the storyboard file, it's not there either.

我已经清理了构建文件夹并在项目中搜索了旧的自定义类名,它至少在 xcode 中没有找到任何东西。我查看了情节提要文件,它也不在那里。

Even if I delete the custom segue all toghether I get:

即使我一起删除自定义转场,我也会得到:

'Could not find a segue class named 'xxxxxxxxx''

The thing is I cannot understand from where it gets 'xxxxxxxxx' above, it is not in the storyboard file or in the code..

问题是我无法理解它从哪里得到 'xxxxxxxxx' 上面,它不在故事板文件或代码中..

[[[self view] viewWithTag:1] resignFirstResponder];

When I debug this is where it goes to thread kill showing the error. I have removed all the outlets, events and segues on the textfield. I have no custom segue using 'xxxxxxxxx' as a class anywhere.

当我调试时,这是线程终止显示错误的地方。我已经删除了文本字段上的所有插座、事件和转场。我在任何地方都没有使用“xxxxxxxxx”作为类的自定义转场。

Is there any other thing I can do to clean the project more thoroughly? Where to begin?

我还能做些什么来更彻底地清理项目?从哪里开始?

采纳答案by nhahtdh

The answer is to reset the storyboard target membership, then reset the simulator.

答案是重置故事板目标成员资格,然后重置模拟器。

回答by chris838

This was what worked for me - I had to select the segue in interface builder and set the module from "None" to my project name, which appeared in the dropdown.

这对我有用 - 我必须在界面构建器中选择 segue 并将模块从“无”设置为我的项目名称,该名称出现在下拉列表中。

回答by Centurion

For others that came from the web searching for the answer: check if you have included implementation file in Build Phases. In my case, I had several targets and the second target was missing this implementation file.

对于从网上搜索答案的其他人:检查您是否在构建阶段中包含了实现文件。就我而言,我有几个目标,而第二个目标缺少此实现文件。

回答by mobibob

Check out this other SO question. Answer to "Issue #1" by declaring the custom-seque-class to be and objective-c class

看看这个其他SO问题。通过将 custom-seque-class 声明为和objective-c 类来回答“问题#1”

Similiar SO Q&A - speaks to a flaw in XCode

类似的 SO Q&A - 谈到 XCode 中的一个缺陷

Summary of answer:

答案摘要:

@objc(CustomSequeLeft2Right)
class CustomSequeLeft2Right {
.
.
.
}

回答by Ammar Mujeeb

My problem was i explicitly set the "Class"name in interface builder; which was not required. It is managed by Xcode and default to UIStoryboardSegue.

我的问题是我在界面构建器中明确设置了“类”名称;这是不需要的。它由 Xcode 管理,默认为 UIStoryboardSegue。