节目接收信号 SIGABRT

Program received signal SIGABRT(节目接收信号 SIGABRT)

本文介绍了节目接收信号 SIGABRT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 iPhone 应用程序中工作,我使用 UIImage 选择器控件从照片库中挑选图像,然后处理它并分别使用 UIImageview 和 UITextview 显示图像和相应的输出.对于某些图像,它工作正常,而对于某些图像程序崩溃了,在用断点检查时,我收到类似 PROGRAM RECEIVED SIGNAL SIGABRT 的消息.任何人都可以建议我如何处理这个错误.注意:对于我得到输出的每个图像,我都用断点检查它.我的示例代码在这里,

I working in iPhone application, i am picking an image from photo library using UIImage picker control, then processing it and displays the image and the corresponding output using UIImageview and UITextview respectively. For some images it working fine and for some of images program crashed and while checking this with break point i am getting message like PROGRAM RECEIVED SIGNAL SIGABRT. can any one suggest me how to handle this error. Note: For every image i am getting output, i checked it with breakpoint. my sample code is here,

显示图像:

 CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 240.0f);
 UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
 [myImage setImage:img];
 myImage.opaque = YES; // explicitly opaque for performance
 [self.view addSubview:myImage];
 [myImage release];

显示文本:

 CGRect frame = CGRectMake(0.0f, 250.0f, 320.0f,25.0f);
 UITextView * tmpTextView = [[UITextView alloc]initWithFrame:frame];
 tmpTextView.text = [NSString stringWithFormat:@"%@%@",@"value: ", somevalue];
 [self.view addSubview:tmpTextView];
 [tmpTextView release];

推荐答案

SIGABRTabort(3) 函数.如果没有更多信息,就不可能准确地知道程序中发生了什么,但调用 abort() 的最常见原因是:

SIGABRT is raised by the abort(3) function. It's impossible to tell exactly what's going on in your program without more information, but the most common reasons that abort() gets called are:

  • 您正在向不支持/实现该消息的 Objective-C 对象发送消息.这会导致可怕的 "无法识别的选择器发送到实例" 错误.
  • 您在某处有一个失败的断言.在定义宏 NDEBUG 的非调试版本中,标准库宏 assert(3) 断言失败时调用 abort()
  • 您遇到了一些内存踩踏/分配错误.当 malloc/free 检测到损坏的堆时,可能会调用 abort()(参见,例如 这个问题)
  • 您正在引发未捕获的异常(C++ 异常或 Objective-C 异常)
  • You're sending a message to an Objective-C object that doesn't support/implement that message. This results in the dreaded "unrecognized selector sent to instance" error.
  • You have a failed assertion somewhere. In non-debug builds that define the macro NDEBUG, the standard library macro assert(3) calls abort() when the assertion fails
  • You have some memory stomping/allocation error. When malloc/free detect a corrupted heap, the may call abort() (see, e.g. this question)
  • You're throwing an uncaught exception (either a C++ exception or an Objective-C exception)

在几乎所有情况下,调试控制台都会为您提供更多关于导致 abort() 被调用的原因的信息,因此请务必查看那里.

In almost all cases, the debug console will give you a little more information about what's causing abort() to be called, so always take a look there.

这篇关于节目接收信号 SIGABRT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:节目接收信号 SIGABRT

基础教程推荐