ios 尝试运行 xcode 5.0 应用程序时发出信号 SIGABRT 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19455840/
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
signal SIGABRT Error when trying to run xcode 5.0 app
提问by Jordan Gagne
Sorry to ask, I have tried everything I have read online, but I keep getting the SIGABRT Error when I try to run an app.
很抱歉问,我已经尝试了我在网上阅读的所有内容,但是当我尝试运行应用程序时,我不断收到 SIGABRT 错误。
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
Error code comes up beside the return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); line.
错误代码出现在 return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 旁边。线。
The debugger just states
调试器只是说明
2013-10-18 10:29:45.270 Black History Month[733:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x903f770> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** First throw call stack:
(0x14a3052 0xea3d0a 0x14a2f11 0x9b3032 0x924f7b 0x924eeb 0x93fd60 0x23291a 0x14a4e1a 0x140e821 0x23146e 0x233010 0x1314a 0x13461 0x127c0 0x21743 0x221f8 0x15aa9 0x138dfa9 0x14771c5 0x13dc022 0x13da90a 0x13d9db4 0x13d9ccb 0x122a7 0x13a9b 0x2712 0x2685)
terminate called throwing an exception
I have tried producing a couple different apps and always get this error so cannot release, I have now tried a simple uiwebview app and the same thing keeps happening. I have tried running on many different deployement targets with no successful outcomes.
我曾尝试制作几个不同的应用程序,但总是出现此错误,因此无法发布,我现在尝试了一个简单的 uiwebview 应用程序,但同样的事情不断发生。我尝试在许多不同的部署目标上运行,但没有成功。
I have tried resetting the simulator, restarting both xcode the simulator, and computer multiple times, turned off auto layout for the xib file. No luck. Any ideas?
我尝试重置模拟器,多次重新启动模拟器和计算机的 xcode,关闭了 xib 文件的自动布局。没运气。有任何想法吗?
Thanks in advance
提前致谢
回答by Kunal Balani
This has nothing to do with Xcode. Your application has thrown a run time exception. Since the exception is not caught anywhere it is poped upto main. Set an exception to All Breakpointto figure out whats wrong. If your app worked in Xcode 4 then check the iOS deployment target. I suspect it has to do with iOS 7 which is default target in Xcode 5.
这与 Xcode 无关。您的应用程序引发了运行时异常。由于在任何地方都没有捕获异常,因此它会弹出到 main 中。为所有断点设置异常以找出问题所在。如果您的应用程序在 Xcode 4 中运行,请检查 iOS 部署目标。我怀疑它与 iOS 7 有关,它是 Xcode 5 中的默认目标。
回答by mike
I also had this error. After spending so much time, I found how to fix it. First of all go the console and see where is the error (mine was related to storyboards and its code) The way I fixed my error was by going in story board. Below the iPhone screen, there will be small yellow button. Right click on it and you will see that is causing error. Delete(x) it if there is yellow error sign.
我也有这个错误。花了这么多时间后,我找到了解决方法。首先去控制台看看错误在哪里(我的与故事板及其代码有关)我修复错误的方法是进入故事板。在 iPhone 屏幕下方,会有黄色的小按钮。右键单击它,您将看到它导致错误。如果有黄色错误标志,则删除(x)它。
If this does not fix your error then try to make new project and then replace its blank files with old files of your old project. I had same error in very beginning and by doing this program run without any error.
如果这不能解决您的错误,请尝试创建新项目,然后用旧项目的旧文件替换其空白文件。我一开始就遇到了同样的错误,并且通过运行这个程序而没有任何错误。
Other people suggests by restarting your laptop and running it again, reseting the iOS simulator, or changing iOS debugger (however this does not work in latest x code since there is only one debugger)
其他人建议通过重新启动您的笔记本电脑并再次运行它、重置 iOS 模拟器或更改 iOS 调试器(但是这在最新的 x 代码中不起作用,因为只有一个调试器)
Hope this helps
希望这可以帮助
回答by Martin R
From the error message
从错误信息
[<UIApplication 0x903f770> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.
[<UIApplication 0x903f770> setValue:forUndefinedKey:]:这个类不是键视图的键值编码兼容。
one can see that you try to set the view
property on an instance of UIApplication
,
but UIApplication
does not have a view
property.
可以看到您尝试view
在 的实例上设置属性UIApplication
,但UIApplication
没有view
属性。
To find the point where the error occurs, set a breakpoint on "All Objective-C Exceptions".
要找到发生错误的点,请在“All Objective-C Exceptions”上设置断点。
回答by Dave G
I also had this error. After spending so much time, I found how to fix it. First >of all go the console and see where is the error (mine was related to storyboards >and its code) The way I fixed my error was by going in story board. Below the >iPhone screen, there will be small yellow button. Right click on it and you will >see that is causing error. Delete(x) it if there is yellow error sign.
我也有这个错误。花了这么多时间后,我找到了解决方法。首先>首先去控制台看看错误在哪里(我的与故事板有关>及其代码)我修复错误的方法是进入故事板。在 >iPhone 屏幕下方,会有黄色的小按钮。右键单击它,您将 > 看到它导致错误。如果有黄色错误标志,则删除(x)它。
I would +1 Viraj's answer, but I don't have the reputation. I can verify that in a Swift project in X-Code 6, this solution works. My problem was:
我会 +1 Viraj 的回答,但我没有声誉。我可以验证在 X-Code 6 的 Swift 项目中,此解决方案有效。我的问题是:
My app ran great on the initial view controller and on the 2nd screen, but upon trying to load the third view controller, my app would crash and return the "SIGABRT" error.
我的应用程序在初始视图控制器和第二个屏幕上运行良好,但在尝试加载第三个视图控制器时,我的应用程序会崩溃并返回“SIGABRT”错误。
The Fixwas indeed to go to the screen where my app was crashing, right click on the yellow icon (which is ABOVE the view in my version of X Code). I had two IB Outlets assigned to views, which did not have connections to the code. I did not need them too (they were old), so I deleted both from within the Outlets inspector in the right sided attributes inspector.
修复确实是转到我的应用程序崩溃的屏幕,右键单击黄色图标(在我的 X 代码版本中的视图上方)。我有两个分配给视图的 IB 插座,它们与代码没有连接。我也不需要它们(它们很旧),所以我从右侧属性检查器中的 Outlets 检查器中删除了它们。