ABPersonViewController未在可编辑模式下打开。当我使用断点时,控制没有到达委托方法。问题出在哪里?这是我的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// 获取通讯录
if ((people != nil) && [人数统计])
{ ABAddressBookRef 地址簿 = ABAddressBookCreate();
//ABPersonViewController *personController = [[ABPersonViewController alloc] initWithNibName:@"ABPersonViewController" bundle:nil];
ABRecordRef person = (ABRecordRef)[people objectAtIndex:indexPath.row];
ABPersonViewController *personController = [[[ABPersonViewController alloc] init]autorelease];
personController.addressBook = 地址簿;
personController.personViewDelegate = 自我;
personController.displayedPerson = 人;
personController.allowsEditing = YES;
//navigationController = [[UINavigationController alloc] init] ;
[自我presentModalViewController:personController动画:YES];
//[self.navigationController pushViewController:personController Animation:YES];
//[personController 释放];
}
别的
{
// 如果“KETAN”不在通讯录中,则显示警报
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
消息:@“在联系人应用程序中找不到 naina”
代表:无
cancelButtonTitle:@"取消"
其他按钮标题:无];
[警报显示];
[警报发布];
}
[人民释放];
}
- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person
属性:(ABPropertyID)属性标识符:(ABMultiValueIdentifier)identifierForValue
{
返回否;
}