如何比较两个 CFUUID (Mac OS X Carbon/CoreFoundation)?
如何比较 Mac OS X 中 CoreFoundation Carbon 框架中的两个 CFUUIDRef
?除了将它们转换为字符串然后进行比较之外,是否有更简单的方法来检查两个 CFUUID 是否相等?
How can I compare two CFUUIDRef
s from the CoreFoundation Carbon framework in Mac OS X? Is there an easier way to check if two CFUUIDs are equal other than converting them to strings and then comparing those?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CFUUID 是一种 CFType,因此您可以使用相同的 CFEqual 您使用的任何函数其他 CF 对象。
A CFUUID is a kind of CFType, so you would use the same CFEqual function you use for any other CF objects.
我不确定本身是否有规范或推荐的方法,但以下内容就足够了吗?
它将按如下方式使用:
或者,因为您只真正对它们是否相等感兴趣:
它将按如下方式使用:
I'm not sure if there is a canonical or recommended method per se, but would the following suffice?
It would be used as follows:
Alternatively, as you're only really interested in whether they are equal or not:
It would be used as follows: