我知道 injectParameterWith 需要一个 id,但我对 Objective-C 还很陌生,不确定那里的交互。这是一个展示我的案例的片段:
return [TyphoonDefinition withClass: AWSServiceConfiguration.class
configuration:^(TyphoonDefinition *definition) {
definition.scope = TyphoonScopeSingleton;
[definition useInitializer:@selector(configurationWithRegion:credentialsProvider:) parameters:^(TyphoonMethod *initializer) {
[initializer injectParameterWith: AWSRegionUSEast1]; //compile error here
[initializer injectParameterWith: self.awsCredentialsProvider];
}];
}];
在这种情况下,正确的用法应该是什么?