【问题标题】:Incompatible block pointer types sending 'id issue with ViperMcFlurry不兼容的块指针类型发送与 ViperMcFlurry 的 'id 问题
【发布时间】:2020-12-16 15:16:49
【问题描述】:

多年来,我一直在我的项目中使用 ViperMcFlurry,没有出现任何问题,而使用 XCode 12 beta 6 时,它会返回 Incompatible block pointer types sending 错误。我尝试了各种方法来修复它,但没有机会。它返回

Incompatible block pointer types sending 'id<RamblerViperModuleOutput> (^)(__strong id<RamblerModuleBetaInput>)' to parameter of type 'RamblerViperModuleLinkBlock' (aka 'id<RamblerViperModuleOutput> (^)(__strong id<RamblerViperModuleInput>)')

我尝试做的是

[[self.transitionHandler openModuleUsingSegue:RamblerAlphaToBetaSegue]
 thenChainUsingBlock:^id<RamblerViperModuleOutput>(id<RamblerModuleBetaInput> moduleInput) {
     [moduleInput configureWithExampleString:exampleString];
     return nil;
 }];

我有

@protocol RamblerModuleBetaInput <RamblerViperModuleInput>

RamblerModuleBetaInput.h。我也有

@protocol RamblerViperModuleInput <NSObject>

RamblerViperModuleInput.h

【问题讨论】:

  • 从错误中 - 它想要 RamblerViperModuleInput 而你正在传递 RamblerViperModuleBetaInput ... 发现差异 - 提示是 beta ...
  • 是的,但是我不能调用 moduleInput configureWithExampleString:exampleString.

标签: swift objective-c ios14 viper-architecture xcode12beta6


【解决方案1】:

请参阅https://github.com/rambler-digital-solutions/ViperMcFlurry/pull/37 或暂时您可以通过在构建设置中添加标志CFLAGS 以禁用检查-Xclang -fcompatibility-qualified-id-block-type-checking 来解决此问题。

【讨论】:

    猜你喜欢
    • 2012-04-22
    • 1970-01-01
    • 2020-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多