XCode custom segue class stuck

南楼画角 提交于 2019-11-30 02:24:05

问题


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.

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.

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..

[[[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.

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


回答1:


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




回答2:


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.




回答3:


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.




回答4:


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

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

Summary of answer:

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



回答5:


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.



来源:https://stackoverflow.com/questions/10687726/xcode-custom-segue-class-stuck

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!