美文网首页
Pointer is missing a nullability

Pointer is missing a nullability

作者: 甘哲157 | 来源:发表于2023-03-20 14:04 被阅读0次
如果 点击 项目名称 --> 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

相关文章

网友评论

      本文标题:Pointer is missing a nullability

      本文链接:https://www.haomeiwen.com/subject/vhwurdtx.html