程序接收到的信号:“SIGABRT”

问题描述:

我开始使用xcode 4.2.1编码客观c ...我正在线上教程,但是我遇到了问题... 代码是这样的:程序接收到的信号:“SIGABRT”

-(IBAction)sum{ 
int x = [[first text] intValue]; 
int y = [[second text] intValue]; 
int t = x + y; 

NSString *result = [NSString stringWithFormat:@"%d",t]; 
[ris setText:result]; 

}

当我开始调试点击,在iPhone模拟器打开并显示错误: 程序接收到的信号:“SIGABRT”

感谢谁可以帮助我!

其中一个变量first,secondris指向解除分配的对象。

我的建议是打造“.gdbinit”的文件在你的home目录

$ ~/ 
在.gdbinit中

把一些未来的断点,我建议这些开始:

fb objc_exception_throw 
fb malloc_error_break 
fb _NSLockError 
fb NSKVODeallocateBreak 
fb _NSFastEnumerationMutationHandler 
fb malloc_printf 
fb _NSAutoreleaseNoPool 
fb CGErrorBreakpoint 

这将帮助您找到SIGABRT源自调试器的位置。