我在定义行
时遇到构建错误 let runFont : CTFontRef = CFDictionaryGetValue(CTRunGetAttributes(run), kCTFontAttributeName)
错误是:无法转换类型' CFString'的值预期参数类型' UnsafePointer' (又名' UnsafePointer<()>')
答案 0 :(得分:5)
尝试
let runFont = unsafeBitCast(CFDictionaryGetValue(CTRunGetAttributes(run), unsafeBitCast(kCTFontAttributeName, UnsafePointer<Void>.self)), CTFontRef.self)
答案 1 :(得分:2)
Swift 3版@vadian回答:
cat file1.json | jq '.[] | select(.file_name | contains("197407"))'