IOS8 Address Book information read-compatible

Source: Internet
Author: User

There is a feature in the project that needs to read the phone of contacts in the Address Book. Before IOS8 is available, mainly using the following three proxy methods to achieve

    1. -(void) Peoplepickernavigationcontrollerdidcancel: (Abpeoplepickernavigationcontroller *) PeoplePicker
    1. -(BOOL) Peoplepickernavigationcontroller: (Abpeoplepickernavigationcontroller *) peoplepicker Shouldcontinueafterselectingperson: (abrecordref) person
    1. -(BOOL) Peoplepickernavigationcontroller: (Abpeoplepickernavigationcontroller *) peoplepicker Shouldcontinueafterselectingperson: (abrecordref): (Abpropertyid) Property identifier: ( Abmultivalueidentifier) identifier
    2. {
    3. return NO;
    4. }


But after the iOS8 update, the tragic thing happened:

Deprecated, use Predicateforselectionofperson and/or-peoplepickernavigationcontroller:didselectperson:instead.

    1. -(BOOL) Peoplepickernavigationcontroller: (Abpeoplepickernavigationcontroller *) peoplepicker Shouldcontinueafterselectingperson: (abrecordref) person Ns_deprecated_ios (2_0, 8_0);
    2. Deprecated, use Predicateforselectionofproperty And/or-peoplepickernavigationcontroller:didselectperson: Property:identifier:instead.
    3. -(BOOL) Peoplepickernavigationcontroller: (Abpeoplepickernavigationcontroller *) peoplepicker Shouldcontinueafterselectingperson: (abrecordref): (Abpropertyid) Property identifier: ( Abmultivalueidentifier) identifier Ns_deprecated_ios (2_0, 8_0);

Two of these methods were killed (this is too common for iOS developers)

Reference document Discovery can be replaced with the following two methods:

    1. Called after a is a person with been selected by the user.
    2. -(void) Peoplepickernavigationcontroller: (abpeoplepickernavigationcontroller*) peoplepicker DidSelectPerson: ( ABRECORDREF) person Ns_available_ios (8_0);
    3. Called after a is been selected by the user.
    4. -(void) Peoplepickernavigationcontroller: (abpeoplepickernavigationcontroller*) peoplepicker DidSelectPerson: ( ABRECORDREF): (Abpropertyid) Property identifier: (abmultivalueidentifier) identifier Ns_available_ios (8_0);

These two methods are as follows, because the structure of the Address book after iOS8 changes: The first layer is a list of people, click on a person to enter after the details of this man.

which

The first method is to select this person and then call.

The second method is called after selecting the person's details.

The code that parses the specific information can be completely unchanged

Transferred from: http://blog.csdn.net/mmoaay/article/details/41350991

IOS8 Address Book information read-compatible

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.