IOS 주소록 정보 읽 기 호 환 실현 방법

IOS 주소록 정보 읽 기 호 환 실현 방법
프로젝트 에는 주소록 에 있 는 연락 처 를 읽 어야 하 는 기능 이 있다.iOS 8 이전에 모두 사용 할 수 있 었 는데 주로 다음 과 같은 세 가지 대리 방법 으로 이 루어 졌 다.

- (void) peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker 

- (BOOL) peoplePickerNavigationController:(ABPeoplePickerNavigationController *)
peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person   

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier 
{ 
  return NO; 
} 

그러나 iOS 8 업데이트 이후 비 극적인 일이 벌 어 졌 다.

// 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)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier NS_DEPRECATED_IOS(2_0, 8_0); 
그 중 두 가지 방법 이 해 킹 되 었 습 니 다.
문 서 를 참고 하면 다음 과 같은 두 가지 방법 으로 대체 할 수 있 습 니 다.

// Called after a person has been selected by the user. 
- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)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)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier NS_AVAILABLE_IOS(8_0); 
이 두 가지 방법 은 이 렇 습 니 다.iOS 8 이후 주소록 의 구조 가 바 뀌 었 기 때 문 입 니 다.1 층 은 인명 목록 이 고 한 사람의 이름 을 클릭 하여 들 어가 면 이 사람의 상세 한 정보 입 니 다.
그 중:
첫 번 째 방법 은 이 사람 을 선택 한 후에 호출 하 는 것 이다.
두 번 째 방법 은 이 사람의 상세 한 정 보 를 선택 한 후에 호출 하 는 것 이다.
구체 적 인 정 보 를 분석 하 는 코드 는 완전히 변 하지 않 을 수 있다.
이상 은 IOS 주소록 정보 읽 기 호 환 의 사례 상세 한 설명 입 니 다.궁금 한 점 이 있 으 시 면 메 시 지 를 남기 거나 본 사이트 지역사회 에 가서 토론 하 십시오.읽 어 주 셔 서 감사합니다. 여러분 께 도움 이 되 기 를 바 랍 니 다.본 사이트 에 대한 지지 에 감 사 드 립 니 다!

좋은 웹페이지 즐겨찾기