w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Crash on second address book (contacts) lookup
-
(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController
*)peoplePicker
      shouldContinueAfterSelectingPerson:(ABRecordRef)person
{
    [self displayPerson:person];
    [self dismissViewControllerAnimated:YES completion:nil];

    return NO;
}

you returning NO ?

Try checking to see if the value exists maybe

ie

- (void)displayPerson:(ABRecordRef)person
{
    NSString* companyName = (__bridge_transfer
NSString*)ABRecordCopyValue(person, kABPersonOrganizationProperty);
    NSString* name = (__bridge_transfer NSString*)ABRecordCopyValue(person,
kABPersonFirstNameProperty);
    NSString* display = @"";

    if (companyName) {
        display = companyName;
    } else if (name) {
        display = name;
    } else {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"No
Details For Contact"
                                                           
message:@"Please update contact with company and/or first name"
                                                           delegate:nil
                                                 
cancelButtonTitle:@"Dismiss"
                                                  otherButtonTitles:nil];
        [alertView show];
    }
}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.