2013-07-23 114 views
40

如何在Xcode中添加異常斷點?Xcode中的異常斷點

int main(int argc, char *argv[]) { 

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 
    int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); 
    [pool release]; 
    return retVal; 
} 

我的項目在下面的代碼中隨機崩潰,在谷歌搜索和一些人建議添加異常斷點。我通過點擊源代碼行添加了斷點。編輯斷點不允許我改變類型。如何添加異常斷點和添加位置? ?(在AppDelegate中

enter image description here

+1

它不會在給定的代碼中崩潰。 – rptwsthi

+1

@rptwsthi,在添加異常斷點後xcode我得到確切的崩潰線。它的偉大..爲什麼不默認啓用這個在調試模式... :) – iPhoneChip

+0

@iPhoneChip:可能是因爲它只是停在那裏,並沒有提供有關例外的信息。 – Rakesh

回答

62

您可以在Xcode中輕鬆添加異常斷點見下圖:。

enter image description here

22

下面是步驟

  • 移動到「 Breakpoint Navigator「

  • 點擊導航器左下角的+符號。

​​

  • 你應該看到這一點。

enter image description here

18

遵循以下步驟:

  • 在xcode的去斷點導航(按命令+ 6 /對於xcode7 +命令+ 7)
  • 點擊+在底部按鈕左
  • 點擊添加異常斷點,按照下圖中的說明

enter image description here