gpt4 book ai didi

ios - Firebase、Swift : Conflicting nullability specifier on return types, 'nullable' 与现有说明符 'nonnull' 冲突

转载 作者:IT王子 更新时间:2023-10-29 05:12:33 26 4
gpt4 key购买 nike

Firebase 3.6.0 中的警告。 Xcode 8 - Swift 3。

这些是 Firebase 类:-

  • @class FIROptions
  • @class FIRAuthCredential
  • @class FIRUserProfileChangeRequest

警告信息:

  • (nullable instancetype)init NS_UNAVAILABLE;

认为这可能是一个错误!。

但如果没有,有什么解决办法吗?

最佳答案

原始答案:从最新的 Firebase (3.7.1) 开始,这个问题已为我解决。只需执行“pod update Firebase”,然后清理您的项目(确保通过 Option 键清理构建文件夹)。

更新后的答案:不,我的错...问题对我来说仍然存在。

进一步挖掘,这里有一个很好的解释:https://stackoverflow.com/a/39233507/3638762

与此同时(因为我对让你抱有希望感到难过)我找到了一个很好的方法来抑制警告。我不得不猜测 -Wnullability 警告类型。 ;-)

在 Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h 中的违规行周围添加这三行#pragma:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability"
- (nullable instancetype)init NS_UNAVAILABLE;
#pragma clang diagnostic pop

干杯!

关于ios - Firebase、Swift : Conflicting nullability specifier on return types, 'nullable' 与现有说明符 'nonnull' 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39564164/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com