【发布时间】:2011-09-07 14:48:15
【问题描述】:
我正在尝试在表委托方法 (DidSelectRowAtIndex) 中打开 ABPersonViewController。但是当我在表格视图中点击我的一位联系人时,它会显示“obj msg send”。帮我 这是我的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // 获取通讯录 if ((people != nil) && [人数统计]) { ABAddressBookRef addressBook = ABAddressBookCreate(); //ABPersonViewController *personController = [[ABPersonViewController alloc] initWithNibName:@"ABPersonViewController" bundle:nil]; ABRecordRef person = (ABRecordRef)[people objectAtIndex:indexPath.row]; ABPersonViewController *personController = [[ABPersonViewController alloc] init]; 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:@"取消" 其他按钮标题:无]; [警报显示]; [警报发布]; } [人民释放]; }【问题讨论】:
-
你想达到什么目的?是否要获取联系人信息?
-
@marvin:当我在可编辑模式下选择联系人的任何名称时,我需要打开 ABPersonViewController。
标签: iphone