ABPersonVIewController at DidSelectRowAtIndex - method
i am trying to open ABPersonViewController at 'didSelectRowAtIndexPath:' method. But when i click on one of my record in table view it donot show anything.I am not able to configure out where is the problem. Where 'people' is array h开发者_如何学JAVAaving contact name. here is my code:
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ABRecordRef person = (ABRecordRef)[people objectAtIndex:indexPath.row]; ABPersonViewController *pvc = [[ABPersonViewController alloc] init]; pvc.personViewDelegate = self; pvc.displayedPerson = person; [self.navigationController pushViewController:pvc animated:YES]; [pvc autorelease]; } - (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue { return NO; }
You need to set displayedProperties
. It is NULL
by default.
For example,
picker.displayedProperties = [NSArray arrayWithObject:
[NSNumber numberWithInt:kABPersonAddressProperty]];
精彩评论