ios Swift:线程 1 信号 SIGABRT
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24204330/
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
Swift: Thread 1 signal SIGABRT
提问by perte
After upgrading Xcode from 5 to 6 beta, almost every project gives me an unexpected error after running the application. There are some other posts with this title but the error is different.
Xcode 从 5 升级到 6 测试版后,几乎每个项目在运行应用程序后都会给我一个意外错误。还有一些其他的帖子有这个标题,但错误是不同的。
In AppDelegate.swift, sometimes the simulator goes completely black, without the error, sometimes it gives me the error on this line:
在 AppDelegate.swift 中,有时模拟器会完全变黑,没有错误,有时它会给我这一行的错误:
class AppDelegate: UIResponder, UIApplicationDelegate {
In Xcode 5 I didn't had this error before, with Deployment Target set to 7.0 or 7.1.
在 Xcode 5 中,我之前没有遇到过这个错误,部署目标设置为 7.0 或 7.1。
Thanks in advance.
提前致谢。
采纳答案by femot
Seems like there was a bug with iOS 7.1 as target.
似乎有一个以 iOS 7.1 为目标的错误。
Running tests on devices with iOS 7.1 installed now works. (17028705)
现在可以在安装了 iOS 7.1 的设备上运行测试。(17028705)
Try it again with the beta 2 update
使用 beta 2 更新再试一次
回答by Brennan Hamstra
This error is caused when you have 2 or more of the same IBOutlets or IBActions in your main.storyboard inspector (right arrow key at the very end of your options). Find out where there is double, and delete the one you don't need! It should work perfectly fine after that.
当您的 main.storyboard 检查器中有 2 个或更多相同的 IBOutlets 或 IBActions 时会导致此错误(选项最后的右箭头键)。找出哪里有double,把不需要的删掉!在那之后它应该可以正常工作。
回答by joesterne
I found this issue happened when I linked @IBOutlet/@IBAction and the linkage broke (renaming for instance). In the main.storyboard inspector, right click (control click) on the elements and delete any bad linkages. Should fix the error if that's the issue.
我发现当我链接 @IBOutlet/@IBAction 并且链接中断(例如重命名)时发生了这个问题。在 main.storyboard 检查器中,右键单击(控制单击)元素并删除任何不良链接。如果这是问题,应该修复错误。
(Xcode 7)
(Xcode 7)
回答by xhinoda
fix my problem:
解决我的问题:
- Go to deployment info and in "Main interface" select your correct storyboard...
- Rerun app.
- 转到部署信息并在“主界面”中选择正确的故事板...
- 重新运行应用程序。
回答by reojased
I know there's already plenty of answers but just to note what happened in my case:
我知道已经有很多答案,但只是要注意在我的情况下发生了什么:
I created the ViewController on the storyboard first and then I created the class, I don't know why this was an error because both class names where identical, but by rewriting the class name on the storyboard helped to "link" correctly the view controller and its file. First create file then ViewController on storyboard to prevent this error.
我首先在情节提要上创建了 ViewController 然后我创建了类,我不知道为什么这是一个错误,因为两个类名都相同,但是通过重写情节提要上的类名有助于正确“链接”视图控制器及其文件。首先创建文件,然后在情节提要上创建 ViewController 以防止出现此错误。
回答by Catherine
My issues with this started after I installed the legacy simulators (iOS7.1) under 'More Simulators' under the simulator build target. Xcode 6 and its native simulator had been running fine until then. What fixed it for me was to close Xcode, delete Derived Data, and under iOS Simulator in the simulator application choose "Reset Content and Settings" then restart the system.
我在模拟器构建目标下的“更多模拟器”下安装了旧模拟器(iOS7.1)后,我的问题就开始了。Xcode 6 及其本机模拟器在此之前一直运行良好。为我修复的是关闭 Xcode,删除派生数据,然后在模拟器应用程序中的 iOS 模拟器下选择“重置内容和设置”,然后重新启动系统。
回答by spookycool
I'm new to the coding world but resolved the painstacking problem. I was getting the same error by doing something and even though i deleted everything around that i couldn't resolve it. It was still giving me the same error, which meant that it is not deleting in some file it stores. Took me a while to figure out which file, finally when i opened the Mainstoryboard as source file, and did search on the error key word which i knew i changed, it gave me the lines it was sitting in. After deleting those lines error got fixed. I know basic HTML so i knew which lines to delete.
我是编码世界的新手,但解决了痛苦的问题。我在做某事时遇到了同样的错误,即使我删除了周围的所有内容,但我无法解决它。它仍然给我同样的错误,这意味着它没有删除它存储的某些文件。我花了一段时间才弄清楚哪个文件,最后当我打开 Mainstoryboard 作为源文件,并搜索我知道我改变的错误关键字时,它给了我它所在的行。删除这些行后错误得到固定的。我知道基本的 HTML,所以我知道要删除哪些行。
I cannot start my project all over again everytime i have this error so i had to find the solution and there was no solution i could find. So i had to do it myself with common sense, as i said i have no knowledge of coding.
每次出现此错误时,我都无法重新开始我的项目,因此我必须找到解决方案,但找不到解决方案。所以我必须用常识自己做,因为我说我不知道编码。
Hope it helps.
希望能帮助到你。