在主文件中出现SIGABRT错误 [英] Getting SIGABRT error in main file

查看:168
本文介绍了在主文件中出现SIGABRT错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的主文件中出现SIGABRT错误,并且不知道该怎么做。

Am getting a SIGABRT error in my main file, and don't know what to do.

Maim文件是:

#import <UIKit/UIKit.h>

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;
}

错误消息突出显示行读数:

The error message highlights the line reading:

int retVal = UIApplicationMain(argc, argv, nil, nil);

并读取:线程1:程序接收信号:SIGABRT

and reads: "Thread 1: Program received signal: "SIGABRT"

你能告诉我什么是错的,我需要做些什么才能让它编译?

Can you tell me what's wrong, and what I need to do to get it compile?

谢谢。

推荐答案

在您的应用程序的其他地方出现错误。您必须运行调试器并逐步执行导致崩溃的屏幕,直到您到达它在 main 中跳转到 SIGABRT 。通常它与内存管理(过度释放对象)有关然后访问它)或 UIKit 对象的不正确初始化,然后 UIKit 尝试渲染(包括返回一个对象)错误的类型,或意外地将错误的标记分配给UI元素,因此它发送了一条它无法处理的消息。如果它是不正确的初始化,你应该得到打印一个额外的错误通知你。

It's an error elsewhere in your application. You'll have to run the debugger and step through the screen that causes the crash until you reach the line where it jumps to SIGABRT in main. Usually it'll have something to do with memory management (over-releasing an object and then accessing it) or improper initialisation of UIKit objects, which UIKit then attempts to render (which includes returning an object of the wrong type, or accidentally assigning the wrong tag to a UI element so it's sent a message it can't handle). If it's improper initialisation, though, you should get an additional error printed to inform you of that.

编辑:实际上,是的,你提到它无法编译? SIGABRT是发送到正在运行的应用程序的信号,因此在编译期间我看不出它是如何出现的。

Actually, yes, you mention it can't compile? SIGABRT is a signal sent to the running application, so I don't see how it can come up during compilation.

这篇关于在主文件中出现SIGABRT错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆