使用未解析的标识符 CNContact [swift 3]
Use of unresolved identifier CNContact [swift 3]
在 swift 2 中,下面这行有效
var contacts = [CNContact]()
但在 swift 3 中出现 'Use of unresolved identifier CNContact' 错误消息。我尝试插入和删除 import Contacts
,因为 xcode 8 忽略导入,因为 viewcontroller 已经是模块 'Contacts' 的一部分。如何解决?
它在 Swift 3.0
中完美运行。我刚刚新建了一个项目,可以自由使用CNContact
.
Possible Workaround:
- 删除派生数据
- 清理你的项目
现在尝试构建您的项目。
在 swift 2 中,下面这行有效
var contacts = [CNContact]()
但在 swift 3 中出现 'Use of unresolved identifier CNContact' 错误消息。我尝试插入和删除 import Contacts
,因为 xcode 8 忽略导入,因为 viewcontroller 已经是模块 'Contacts' 的一部分。如何解决?
它在 Swift 3.0
中完美运行。我刚刚新建了一个项目,可以自由使用CNContact
.
Possible Workaround:
- 删除派生数据
- 清理你的项目
现在尝试构建您的项目。