请升级最新版本,作者已适配 xcode12 https://github.com/12207480/TYAttributedLabel

Xcode 12 编译 TYAttributedLabel 报以下错误

Incompatible block pointer types sending 'void(^__strong)(__strong id<TYLinkStorageProtocol>)' to parameter of type 'void(^)(__strong id<TYTextStorageProtocol>)'

https://img.wangquanwei.com/wp-content/uploads/2020/09/4215AD78A2E67E9AA550DC1A39B2E36A.jpg

解决方法

找到 Build Setting -> Other C Flags
https://img.wangquanwei.com/wp-content/uploads/2020/09/B0719E61-357A-4823-8FE9-FE5E71BC6F99.jpeg
输入 -Xclang -fcompatibility-qualified-id-block-type-checking

-Xclang -fcompatibility-qualified-id-block-type-checking

https://img.wangquanwei.com/wp-content/uploads/2020/09/8E1F80E6-9D03-4C78-810E-DE1299B1AD6E.jpeg
此方法只适用于 Xcode 12 及以上版本使用,如果使用 Xcode 11 请删除 -Xclang -fcompatibility-qualified-id-block-type-checking 否则编译会失败