You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good. I expect Typhoon to find me some instance of quux and resolve things for me. I have no idea where I'll get my quux. But I've expressed that one is required. This is good behaviour for modules because the app will not run if no suitable instance of quux was found in any of the activated assemblies.
But, if I want to use a specific initialiser instead of using [[FooBar alloc] init], I'm out of luck:
I'm forced to introduce parameter for quux to make it a runtime argument (not desired; I don't want this to be used as a factory method).
Surely there should be analog. i.e. perhaps there should be a version of injectParameter that just doesn't accept any parameters, which actually resolves the component from all activated assemblies and barfs if it doesn't find it, just like injectProperty:(SEL) would.
The text was updated successfully, but these errors were encountered:
initializer and method injections don't have to be runtime arguments. Inject with another definition (as shown in the quick start) or any of the options in the section "What Can Be Injected"
Whatever the case it must be explicit, auto injection is not supported. This is because the Objective-C runtime doesn't provide type information for method or initializer parameters, only for properties.
Suppose we have a class
FooBar
, which has a private propertyquux
. Right now, it's possible to say:Good. I expect Typhoon to find me some instance of
quux
and resolve things for me. I have no idea where I'll get myquux
. But I've expressed that one is required. This is good behaviour for modules because the app will not run if no suitable instance ofquux
was found in any of the activated assemblies.But, if I want to use a specific initialiser instead of using
[[FooBar alloc] init]
, I'm out of luck:I'm forced to introduce parameter for
quux
to make it a runtime argument (not desired; I don't want this to be used as a factory method).Surely there should be analog. i.e. perhaps there should be a version of
injectParameter
that just doesn't accept any parameters, which actually resolves the component from all activated assemblies and barfs if it doesn't find it, just likeinjectProperty:(SEL)
would.The text was updated successfully, but these errors were encountered: