我在 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];
SIGABRT
由 abort(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:
NDEBUG
的非调试版本中,标准库宏 assert(3)
断言失败时调用 abort()
malloc
/free
检测到损坏的堆时,可能会调用 abort()
(参见,例如 这个问题)NDEBUG
, the standard library macro assert(3)
calls abort()
when the assertion failsmalloc
/free
detect a corrupted heap, the may call abort()
(see, e.g. this question)在几乎所有情况下,调试控制台都会为您提供更多关于导致 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!