2012-01-13 95 views
0

我開始使用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」

感謝誰可以幫助我!

回答

0

其中一個變量first,secondris指向解除分配的對象。

1

我的建議是打造「.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源自調試器的位置。

相關問題