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
-(void) Peoplepickernavigationcontrollerdidcancel: (Abpeoplepickernavigationcontroller *) PeoplePicker
-(BOOL) Peoplepickernavigationcontroller: (Abpeoplepickernavigationcontroller *) peoplepicker Shouldcontinueafterselectingperson: (abrecordref): (Abpropertyid) Property identifier: ( Abmultivalueidentifier) identifier{ return NO;}
But after the iOS8 update, the tragic thing happened:
Deprecated, use Predicateforselectionofperson and/or-peoplepickernavigationcontroller:didselectperson:instead.- (BOOL) Peoplepickernavigationcontroller: (Abpeoplepickernavigationcontroller *) peoplepicker Shouldcontinueafterselectingperson: (abrecordref) person Ns_deprecated_ios (2_0, 8_0);//DEPRECATED, use Predicateforselectionofproperty And/or-peoplepickernavigationcontroller:didselectperson:property:identifier: instead.-(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:
Called after a person have been selected by the user.-(void) Peoplepickernavigationcontroller: (abpeoplepickernavigation controller*) Peoplepicker Didselectperson: (abrecordref) person Ns_available_ios (8_0);//called after a property has been Selected by the user.-(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
IOS8 Address Book information read-compatible