3
我遇到一個問題,我在調試器中運行我的應用程序時在特定點收到GDB中斷,但沒有顯示錯誤消息。在沒有顯示錯誤的情況下調試GDB中斷
的代碼中的問題是:
- (void)AddContactViewControllerDidFinish:(AddContactViewController *)controller {
// Save contact & requirement
NSManagedObjectContext *context = [self managedObjectContext];
Contact *contactObj = [NSEntityDescription insertNewObjectForEntityForName:@"Contact" inManagedObjectContext:context];
[contactObj setValue:[[[controller.textFields objectAtIndex:0] objectAtIndex:0] text] forKey:@"Name"];
[contactObj setValue:[[[controller.textFields objectAtIndex:0] objectAtIndex:1] text] forKey:@"PhoneBH"];
[contactObj setValue:[[[controller.textFields objectAtIndex:0] objectAtIndex:2] text] forKey:@"PhoneAH"];
[contactObj setValue:[[[controller.textFields objectAtIndex:0] objectAtIndex:3] text] forKey:@"Mobile"];
[contactObj setValue:[[[controller.textFields objectAtIndex:0] objectAtIndex:4] text] forKey:@"Email"];
UISwitch *switcho = [[controller.textFields objectAtIndex:0] objectAtIndex:5];
[contactObj setValue:[NSNumber numberWithBool:switcho.on] forKey:@"PropertyAlerts"];
NSDate *LastModified = [[NSDate alloc] init];
[contactObj setValue:LastModified forKey:@"LastModified"];
[LastModified release];
[openhome addContactObject:contactObj];
[contactObj addOpenhomeObject:openhome];
這裏的最後一行就是我收到的中斷。基本上我在這裏做的是準備contactObj以使用核心數據進行保存,並且當在模式中顯示的視圖控制器中按下完成按鈕時調用此委託方法。
所以我的問題是,因爲沒有顯示錯誤我該如何去尋找是什麼導致中斷?