我打算转换ConstUnsafePointer<()>到CTRunRef,但发生错误
var run: CTRunRef = CFArrayGetValueAtIndex(runArray, runIndex) as CTRunRef
编者说: ' ConstUnsafePointer≤()>'不可转换为' CTRunRef'
答案 0 :(得分:1)
看起来像这样
let runArray = ((CTLineGetGlyphRuns(line) as [AnyObject]) as! [CTRunRef])
for runIndex in 0..<CFArrayGetCount(runArray) {
let run: CTRunRef = runArray[runIndex]
}