Xcode 4.6.1 与 iOS 6.1。我在 StackMob 中使用远程数据库。应用程序首先给出一个错误,在我点击播放几次后,它运行良好并且与服务器通信正常。不确定如何检测问题,是否应该担心?
我有以下异常断点设置:
应用程序运行,然后在以下行停止:
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"User" inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"email == %@", self.emailAddressField.text];
[fetchRequest setPredicate:predicate];
NSError *error = nil;
NSArray *fetchedObjects = [[self managedObjectContext] executeFetchRequest:fetchRequest error:&error];
所以我将上面的行更改为:
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"User" inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"username == %@", self.usernameField.text];
[fetchRequest setPredicate:predicate];
[managedObjectContext executeFetchRequest:fetchRequest onSuccess:^(NSArray *fetchedObjects)
{
现在当我运行程序时,出现以下错误:
与
所以我点击播放按钮
我收到以下错误:
在我再次点击播放后,应用程序继续运行,就好像什么也没发生一样?我应该担心吗?
最佳答案
一旦调试器停止在异常上,您可以使用简单的 lldb 命令检查异常是什么。在此处选择线程 6 中的异常:
然后如果你在模拟器类型上运行:
po $eax
如果你在设备上运行:
po $r0 (for 32-bit)
po $x0 (for 64-bit)
您应该得到异常的描述。
关于ios - XCode:异常。如何检测原因?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16267930/