我在程序集中有这个初始化程序:
- (id<APBSearchWireframeInterface>)searchWireframe {
return [TyphoonDefinition withClass:[APBSearchWireframe class] configuration:^(TyphoonDefinition *definition) {
[definition injectProperty:@selector(searchViewController) with:[self searchViewController]];
[definition injectProperty:@selector(mapFromSearchInput) with:[[self mapAssembly] mapWireframe]];
}];
}
最后一行,注入时mapFromSearchInput
我收到警告
undeclared selector 'mapFromSearchInput'
我在私有扩展中拥有这两个属性APBSearchWireframe
@interface APBSearchWireframe()
@property (nonatomic, readwrite, strong) id<APBSearchView> searchViewController;
@property (nonatomic, readwrite, strong) id<APBMapFromSearchInput> mapFromSearchInput;
@end
并mapWireframe
符合多种接口
- (id<APBMapWireframeInterface, APBMapFromSearchInput>)mapWireframe;
如果我将属性定义从私有扩展名移动到 .h,警告就会消失。为什么第二次注入时出现错误,而第一次则没有?我已正确完成所有导入,并且该应用程序运行良好,但这个警告真的很烦人......
谢谢你。