iOS API 没有提及 CoreText API 的线程限制。当调用不使用 CGContextRef 的函数时,在非主线程上使用它们在多大程度上是安全的?
具体来说,我正在尝试使用自定义截断算法创建一组 NSAttributedString,并且我希望能够在后台进行这项工作。我只使用:
CTLineCreateWithAttributedString
CTLineGetTypographicBounds
CTLineGetStringIndexForPosition
最佳答案
我应该检查 <CoreText/CoreText.h>
.
/*!
@header
Thread Safety Information
All functions in this header are thread safe unless otherwise specified.
*/
关于multithreading - 在非主线程中使用不使用 CGContextRef 的 iOS CoreText API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5671956/