1

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
{
    返回否;
}
4

1 回答 1

0

关于可编辑模式,您走在正确的轨道上。但是,您首先需要ABPersonViewController从导航控制器推送(请参阅文档

于 2012-01-10T03:03:46.503 回答