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) person
- -(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 is a person with been selected by the user.
- -(void) Peoplepickernavigationcontroller: (abpeoplepickernavigationcontroller*) peoplepicker DidSelectPerson: ( ABRECORDREF) person Ns_available_ios (8_0);
- Called after a is 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
Transferred from: http://blog.csdn.net/mmoaay/article/details/41350991
IOS8 Address Book information read-compatible