我只在模拟器中遇到了这个崩溃。在真实设备上,它可以正常工作和调试。(因此它不是太重要,但我正在做一个模拟器可以派上用场的演示文稿。)
- (BOOL)peoplePickerNavigationController:
(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
[self displayPerson:person];
if ([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]){
[self dismissViewControllerAnimated:YES completion:nil];
} else {
[self dismissModalViewControllerAnimated:YES];
}
return NO;
}
崩溃发生在:
[self dismissViewControllerAnimated:YES completion:nil];
我所看到的是:"Thread 1: EXC_BREAKPOINT (code=EXC_I386_BTP, subcode=0x0)"
调试窗口中没有特定的输出。Zoombies 已启用。我做ARC。我正在使用情节提要,但我使用以下代码以编程方式调用 ABPersonPicker...:
-(void)showPeoplePickerController
{
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
if ([self respondsToSelector:@selector(presentViewController:animated:completion:)]) {
[self presentViewController:picker animated:YES completion:nil];
} else {
[self presentModalViewController:picker animated:YES];
}
return;
}
请记住,它在我拥有的设备(iPod Touch 第 4 代、iPhone 4 和 iPhone 4S)上运行良好