user720235
user720235

Reputation: 85

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 having 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;
}

Upvotes: 0

Views: 355

Answers (1)

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

You need to set displayedProperties. It is NULL by default.

For example,

     picker.displayedProperties = [NSArray arrayWithObject:
          [NSNumber numberWithInt:kABPersonAddressProperty]];

Upvotes: 1

Related Questions