我遇到问题,我在调试中运行应用程序时在特定点收到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以使用Core Data进行保存,并且当在模式中显示的视图控制器中点击Done按钮时,将调用此委托方法。
所以我的问题是,因为没有显示错误如何找到导致中断的原因?
答案 0 :(得分:1)
尝试启用乐器和NSZombie。有时XCode行为很奇怪,只是停止执行而不显示错误,但是仪器应该更加冗长。