Carnet d'Adresses de Contact de crash sur iOS 10 beta

Lors d'un clic sur tous les contacts dans le carnet d'adresse (à l'intérieur de mon application) c'est de s'écraser sur iOS 10 bêta et de travail bien sur iOS 9 versions;

C'est le crash

*** Terminating app due to uncaught exception 'CNPropertyNotFetchedException', reason: 'A property was not requested when contact was fetched.'
*** First throw call stack:
(0x1cf11a07 0x1c62af63 0x1cf1194d 0x246f0f4f 0x246c6a71 0x1ce355eb 0x1ce2e19b 0x246c69cf 0x246c6883 0x25e4a375 0x2538f283 0x254204ef 0x25420bb1 0xe9da97 0xe9da83 0xea2321 0x1cecf18f 0x1cecd477 0x1ce1e6bd 0x1ce1e549 0x1e54ebfd 0x21f961e3 0x21f90947 0x966c9 0x1ca9e507)
libc++abi.dylib: terminating with uncaught exception of type NSException

Et voici le code pour ouvrir le carnet d'adresses à l'intérieur de mon application:

-(void)showContactPicker {
__weak RecieverSelectorViewController *weakSelf = self;
    ABPeoplePickerNavigationController* picker = [[ABPeoplePickerNavigationController alloc] init];
    picker.peoplePickerDelegate = self;
    picker.modalPresentationStyle = UIModalPresentationFullScreen;
    picker.modalTransitionStyle = UIModalPresentationPopover;
    [self presentViewController:picker
                       animated:YES
                     completion:^{
                         [weakSelf hideLoadingAnimation];

                         //animation to show view controller has completed.
                     }];
}



- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
    [self setSelectedPerson:person];
}

- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker didSelectPerson:(ABRecordRef)person {
    [self setSelectedPerson:person];
}

-(void)setSelectedPerson:(ABRecordRef)person {


    NSString *contactName = CFBridgingRelease(ABRecordCopyCompositeName(person));

    ABMultiValueRef phoneRecord = ABRecordCopyValue(person, kABPersonPhoneProperty);
    CFStringRef phoneNumber = ABMultiValueCopyValueAtIndex(phoneRecord, 0);

    self.isSenderReciever = NO;

    NSString *phone = [PorterUtils
                       extraLast10DigitsFromDigitString:[PorterUtils
                                                         extractNumberFromText:(__bridge_transfer NSString *)phoneNumber]];




    //Handling Social Media Contacts - Crash

    if(contactName.length>0 && phone.length>0){

      [self setRecieverName:contactName
                   number:phone];
       CFRelease(phoneRecord);
    }

}

C'est s'écraser uniquement sur iOS 10 bêta publique.

  • Nous avons besoin de voir la stacktrace.
  • comment puis-je obtenir?
  • c'est swift ryt
  • faites u ont pour objectif de code c pour qui?
  • Non Mais Simple pour convertir Objective C
  • dernière aide, comment puis-je obtenir le nom et numéro de CNContacts objet ? suis seulement une partie de ce nom quand j'utilise"givenname" ou "nameprefix" ou namesuffix
  • voici modification - corriger accessproperty

InformationsquelleAutor Bangalore | 2016-07-12