我已經在我的IOS 8人員選取代表代碼中遇到一個奇怪的問題。只有IOS 8 - 的ABPeoplePickerNavigationController - 取消委託方法的工作,別人不
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker;
{
[self dismissViewControllerAnimated:YES completion:NULL];
}
方法正在被調用。我已審查其他問題,並通過調用舊IOS 7方法
- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier: (ABMultiValueIdentifier)identifier {
[self peoplePickerNavigationController:peoplePicker shouldContinueAfterSelectingPerson:person property:property identifier:identifier];
}
做出選擇聯繫人的重要IOS 8委託方法的變化,但它永遠不會被調用。
我設置在調用視圖 - 控制didLoad委託,
和它完美的作品在IOS 7。這是一個故事板的應用程序。
我看到了同樣的問題在這裏評論問:ABPeoplePickerNavigationController changes with iOS8?
,但從來沒有找到答案。很明顯,我的某個地方出了錯,但我找不到它。
更新:根據要求,這裏是我如何設置委託:
self.picker = [[ABPeoplePickerNavigationController alloc] init];
self.picker.peoplePickerDelegate = self;
而且,在@interface:
@interface TreatmentsAddEntryTVC : UITableViewController<UITextViewDelegate,ABPeoplePickerNavigationControllerDelegate>
我已經擁有了它 - 並沒有命中。 – jmf1205 2014-11-02 06:17:19
您在視圖控制器的.h文件中爲您的「@ interface'」聲明添加了「」嗎?另外,您應該編輯您的問題以顯示如何在視圖控制器中設置委託。 –
2014-11-02 06:30:25
將您的聲明更改爲:「'@interface TreatmentsAddEntryTVC:UITableViewController'」並查看會發生什麼情況。 –
2014-11-02 06:41:21