【问题标题】:How do we know which CNContainer represents iCloud?我们怎么知道哪个 CNContainer 代表 iCloud?
【发布时间】:2015-11-03 21:33:55
【问题描述】:

Also asked on the Apple dev forums.

它的type 是CNContainerType.CardDAV。

在我的测试中,它的名字是“卡片”。是通用的吗?

【问题讨论】:

  • 哦,没关系。 containersMatchingPredicate(nil).first {$0.isiCloud} 将返回 nil,我会处理它,但我更喜欢 iCloud。
  • 我什至不认为 $0.isiCloud 会起作用。 CNContainer 没有那个属性?你是怎么想出来的?

标签: ios contacts


【解决方案1】:

联系人框架不提供有关特定容器是否对应于 iCloud 的信息。您可以保证,如果 iCloud 容器存在,它将是 CardDAV 类型。否则,你没有知识。如果您需要更多,并且有很好的用例,请向 Apple 提交错误报告。

【讨论】:

  • 这里通过一些奇妙的文字加工暗示了这一点,但也可能有其他 CardDAV 容器/源不是 iCloud。无法区分实际上是 iCloud 的容器/源和名为 iCloud 的容器/源。
猜你喜欢
  • 1970-01-01
  • 2017-03-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多