2

ユーザーに人の連絡先ページを表示したいのですが、 null が表示されています。私のコードは以下のとおりです。画像ボックスが空の黒い連絡先ページしか表示されません

    ABPersonViewController *personController = [[ABPersonViewController alloc] init];

NSDictionary *dic = [arrayData objectAtIndex:indexPath.row];

ABRecordRef ref = (__bridge ABRecordRef)[dic objectForKey:@"ABRecordRef"];

ABAddressBookRef addressBook = ABAddressBookCreate();

NSLog(@"%@",ref);

ABRecordID recId = ABRecordGetRecordID(ref);

personController.displayedPerson = ABAddressBookGetPersonWithRecordID(addressBook, recId);

personController.displayedProperties = [NSArray arrayWithObjects:
                                        [NSNumber numberWithInt: kABPersonNicknameProperty],
                                        [NSNumber numberWithInt: kABPersonPhoneMobileLabel],
                                        [NSNumber numberWithInt:kABPersonAddressProperty],
                                        nil];


personController.allowsEditing = YES;
personController.personViewDelegate = self;     
personController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Return" style:UIBarButtonItemStylePlain target:self action:@selector(wapis)];

[[self navigationController] pushViewController:personController animated:YES];
4

0 に答える 0