multithreading - 在非主线程中使用不使用 CGContextRef 的 iOS CoreText API

标签 multithreading ios core-text

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/

相关文章:

c - Pthread 程序花费比预期更长的时间

multithreading - 在事件图中建模线程间通信

c++ - 如何打印linux上进程拥有的所有线程的线程ID

c# - 不能将线程与非静态方法一起使用

ios - Twitter api 文本字段值被截断

swift - 将 NSFont 转换为 CGFont——不可能?

ios - 我的媒体音量无法在控制中心和 AVRoutePickerView 中调节,仅当用户单击设备上的音量按钮时才起作用

ios - 使用 swift 获取对象关系谓词的核心数据

ipad - 是否有 UIWebView 的替代方案来动态显示格式化文本?

ios - CustomTextField - 自动完成/自动更正不会在点击时关闭