Pointer is missing a nullability

2023-03-20  本文已影响0人  甘哲157
如果 点击 项目名称 --> TARGETS --> Build Settings --> 
search: Treat Warnings as Errors --> 将 NO 设置为 YES
再次编译 会将所有的 warnings 当作 error 来处理 

例如:Pod  库里报出的错误, 因为把警告当成了错误 :
Pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)

解决方案:

您好,Swift 项目中 是需要把  
Swift Compiler - Warnings Policies --> Treat Warnings As Errors --> NO 的 ,

而 Apple Clang - Warnings Policies --> Treat Warnings As Errors --> 可选择性设置 YES/NO

Swift 只需 把 下面的那个设置 为 NO 即可

简单介绍
https://www.jianshu.com/p/b6197f7541fb

https://zhuanlan.zhihu.com/p/32756610?from_voters_page=true

上一篇 下一篇

猜你喜欢

热点阅读