我在main.m“线程1:信号SIGABRT”中有错误。我怎样才能解决这个问题? [英] I have an error in main.m "Thread 1: signal SIGABRT" How can I fix this?

查看:375
本文介绍了我在main.m“线程1:信号SIGABRT”中有错误。我怎样才能解决这个问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在main.m文件中的代码如下。从我开始编写这个应用程序时起,我根本没有改变它。

My code in the main.m file is as follows. I haven't changed it at all from when I started programming this app.

#import <UIKit/UIKit.h>

#import "rickAppDelegate.h"

int main(int argc, char *argv[])
{
    @autoreleasepool {
    return UIApplicationMain(argc, argv, nil, NSStringFromClass([rickAppDelegate class]));
    }

}

我收到SIGABRT错误'返回UIApplicationMain'行。
我的程序是一个显示红色按钮的应用程序,当您按下它时,它会播放视频。使用本教程实现iAd后出现此错误:
http ://www.ioslearner.com/implement-iads-tutorial-iphone-ipad-sdk/

I am getting the SIGABRT error on the 'return UIApplicationMain' line. My program is an app which displays a red button and when you press it, it plays a video. This error appeared after I implemented iAds using this tutorial: http://www.ioslearner.com/implement-iads-tutorial-iphone-ipad-sdk/

它起初工作,但后来我开始接收SIGABRT错误。我做了很多搜索,无法弄清楚如何解决这个问题,在所有的网站中,有人问这个,然后自己弄清楚,或者通过一个我无法理解的非常含糊的答案。请帮忙!如果您回答,请具体说明我必须做什么。如果需要,我可以发布我的整个代码。
提前致谢!

It worked at first, but then I started receiving the SIGABRT error. I have done a lot of searches and cannot figure out how to fix this, In all the websites, someone asks this and then figures it out themselves or through a very vague answer which I am not able to understand. Please Help! If you answer, could you please be specific as to what I have to do. If required I can post my entire code. Thanks in advance!

推荐答案

当你得到 SIGABRT main 的那一行,这意味着你的程序引发了异常。堆栈跟踪显示异常被捕获的位置,而不是引发的位置。通常这没有帮助。

When you get SIGABRT on that line of main, it means that your program has raised an exception. The stack trace shows where the exception is being caught, not where it's being raised. Usually this is not helpful.

要调试问题,你可以做两件事:

To debug the problem, you can do two things:


  1. 单击调试器控制栏中的继续程序执行按钮,或从菜单栏中选择程序>调试>继续。这将使程序继续进行例外处理。它将向调试器控制台打印一条消息,以帮助您了解错误。 (在实际打印消息之前,您可能需要继续执行几次。)仔细阅读消息!它们通常包含有用的信息。

  1. Click the "Continue Program Execution" button in the debugger control bar, or choose Program > Debug > Continue from the menu bar. This will let the program continue the exception-raising process. It will print a message to the debugger console that will help you understand what's wrong. (You may have to continue execution a couple of times before it actually prints messages.) Read the messages carefully! They usually contain helpful information.

设置一个异常断点。这将使Xcode在引发异常的位置停止你的程序,这样你就可以看到代码和导致问题的堆栈跟踪。

Set an exception breakpoint. This will make Xcode stop your program at the point where the exception is being raised, so you can see the code and the stack trace that is causing the problem.

这篇关于我在main.m“线程1:信号SIGABRT”中有错误。我怎样才能解决这个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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