ABPeoplePickerNavigationController changes with iOS8?

后端 未结 3 1573
一生所求
一生所求 2020-12-02 22:16

Since I have updated XCode (6.0, 6A313) and my iOS (8.0, 12A365) on the iPhone to gm seeds, the ABPeoplePickerNavigationController code doesn\'t work like before.

3条回答
  •  被撕碎了的回忆
    2020-12-02 22:51

    iOS 8 requires a new delegate method be implemented for this:

    - (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
    }
    

    Keep the old delegate method in place to support iOS 7 or earlier. What I do in my app is call the iOS 7 delegate method from the iOS 8 delegate method:

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

    If this delegate method isn't implemented in iOS 8, tapping the value causes the action. When implemented, the delegate is called instead with the selected value.

提交回复
热议问题