gpt4 book ai didi

ios - Swift - 如何将 ConstUnsafePointer<()> 转换为 CTRunRef

转载 作者:行者123 更新时间:2023-11-28 07:17:11 31 4
gpt4 key购买 nike

我打算将 ConstUnsafePointer<()> 转换为 CTRunRef,但出现错误

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

编译器说:“ConstUnsafePointer<()>”不能转换为“CTRunRef”

最佳答案

这样看

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

关于ios - Swift - 如何将 ConstUnsafePointer<()> 转换为 CTRunRef,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25174927/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com