Swift - 如何转换ConstUnsafePointer<()>到CTRUNRef

时间:2014-08-07 05:39:27

标签: ios swift

我打算转换ConstUnsafePointer<()>到CTRunRef,但发生错误

var run: CTRunRef = CFArrayGetValueAtIndex(runArray, runIndex) as CTRunRef

编者说: ' ConstUnsafePointer≤()>'不可转换为' CTRunRef'

1 个答案:

答案 0 :(得分:1)

看起来像这样

let runArray = ((CTLineGetGlyphRuns(line) as [AnyObject]) as! [CTRunRef])
for runIndex in 0..<CFArrayGetCount(runArray) {
    let run: CTRunRef = runArray[runIndex]
}