问题描述
多年以来,我一直在项目中使用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
解决方法
请参阅https://github.com/rambler-digital-solutions/ViperMcFlurry/pull/37,或者暂时可以通过在构建设置CFLAGS
中添加标记来禁用检查-Xclang -fcompatibility-qualified-id-block-type-checking
来解决此问题。