Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
将 Swift 3 中的 Dictionary 转换为 CFDictionary 的正确方法是什么?这样写合法吗?
var dictionary:Dictionary<NSString, Int> = [:]
接着
dictionary as CFDictionary
是的,你可以这么做。您的解决方案将起作用,您也可以这样做。
var dictionary = [ key:value ] as CFDictionary
您可以从这里进一步参考