问题描述
每次我在iPad模拟器上运行我的应用程序时,它都能完美运行。但是,当我在iPhone模拟器上运行它时,当我单击主页按钮时,我在main.m文件中的Xcode中出现错误,说线程1:程序接收信号:SIGABRT。它是突出在我的main.m的代码行:返回UIApplicationMain(的argc,argv的,零,NSStringFromClass([AppDelegate类]));
Everytime I run my app on the iPad simulator, it works flawlessly. But, when I run it on the iPhone simulator, when I click the home button, I get an error in Xcode in my main.m file, saying "Thread 1: Program received signal: SIGABRT". It is highlighting this line in my main.m's code: return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
当我按下iPad模拟器上的主页按钮时,不会发生此问题。我在这里做了很多关于这个错误的研究,但似乎没有什么用处。有谁知道如何解决这个问题?
This issue doesn't occur when I press the home button on the iPad simulator at all though. I've done a lot of research on here about this error, but nothing useful seemed to turn up. Does anyone know how to go about fixing this?
编辑:这是调试器控制台的更多信息
here is some more info from the debugger console
无法与引导服务器注册None.TestApplication错误:未知错误代码
这通常意味着这个过程的另一个实例已经运行或在debugger.sharedlibrary应用负载规则是挂满
当前语言:auto;目前objective-c
(gdb)
"Couldn't register None.TestApplication with the bootstrap server. Error: unknown error code.This generally means that another instance of this process was already running or is hung in the debugger.sharedlibrary apply-load-rules allCurrent language: auto; currently objective-c(gdb)
推荐答案
该行 UIApplicationMain(argc,argv,nil,NSStringFromClass([AppDelegate class]));
只是意味着在程序运行期间抛出了异常。这可能来自内存问题,简单的运行时错误。查看目标调试器控制台;它将告诉您错误发生的位置。
The line UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
just means that an exception was thrown during the running of your program. This could range from a memory problem, to a simple runtime error. Look in the target debugger console; it will tell you where the error occurred.
由于编辑而编辑问题:我之前已经通过将iOS模拟器恢复为出厂默认设置解决了这个问题(打开iOS模拟器M左上角的enu - >重置内容和设置)。然后退出iOS模拟器和Xcode,然后重新启动计算机。这将摆脱该过程的另一个实例。
Edited due to edited question: I have solved this question before by restoring the iOS simulator to factory defaults (Open "iOS Simulator" Menu in the upper left -> Reset Content and Settings). Then quit the iOS simulator and Xcode, and then restart your computer. This will get rid of the other instance of the process.
这篇关于Xcode 4.2 SIGABRT错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!