ios - 找不到 'ABPeoplePickerNavigationControllerDelegate' 的协议(protocol)声明

标签 ios swift delegates addressbook peoplepicker

在一个已经有 ObjC 的项目中,我正在添加一个 Swift 类

import AddressBookUI
class MyVC : UITableViewController, ABPeoplePickerNavigationControllerDelegate {
}

MyApp-Swift.h:289:42:找不到“ABPeoplePickerNavigationControllerDelegate”的协议(protocol)声明;您是指“UINavigationControllerDelegate”吗?

不,Swift,我的意思是 ABPeoplePickerNavigationControllerDelegate。真的很想知道我在这里做错了什么......

最佳答案

FWIW,这在纯 Swift 中与 ABRecord 一起使用,但在 Objective-C 兼容性 header 中不起作用的原因是有一个 typealias 而后者显然没有'正确翻译回去:

typealias ABRecordRef = ABRecord

参见 https://developer.apple.com/library/prerelease/ios/documentation/AddressBook/Reference/ABRecordRef_iPhoneOS/index.html#//apple_ref/c/tdef/ABRecordRef

可能值得提交雷达 📡

关于ios - 找不到 'ABPeoplePickerNavigationControllerDelegate' 的协议(protocol)声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29253262/

相关文章:

ios - faSTLane Action appium 的spec_path 是什么?

c# - 使用 DI 的单一方法委托(delegate) vs 接口(interface)

swift 3 : Delegate within TapGestureRecognizer in Generics doesn't get called

c# - C#中是否有所有委托(delegate)的基类

swift - Swift 项目中的 MMDrawer 库用于侧抽屉,如何关闭抽屉?

Swift:弄清楚实际需要实现哪些协议(protocol)方法和属性?

objective-c - writeToFile 给出 NSUnderlyingError=0x6a3d450 "The operation couldn’ t 完成。是一个目录”

ios - 根据所选日期快速从手动 datePicker 获取时间

带有 AttributedTitle 的 IOS UIButton

ios - Swift:将 [String] 拆分为具有给定子数组大小的 [[String]] 的正确方法是什么?