Cannot convert value of type 'CFString' to expected argument type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>')
问题 I am getting a build error, when I define the line let runFont : CTFontRef = CFDictionaryGetValue(CTRunGetAttributes(run), kCTFontAttributeName) And the error is: Cannot convert value of type 'CFString' to expected argument type 'UnsafePointer' (aka 'UnsafePointer<()>') 回答1: Try let runFont = unsafeBitCast(CFDictionaryGetValue(CTRunGetAttributes(run), unsafeBitCast(kCTFontAttributeName, UnsafePointer<Void>.self)), CTFontRef.self) 回答2: Swift 3 version of @vadian answer: let runFont =