The selector specified as initializer is not called.
return [TyphoonDefinition withClass:[AppDelegate class] configuration:^(TyphoonDefinition *definition) {
[definition useInitializer:@selector(initWithString:)
parameters:^(TyphoonMethod *initializer) {
[initializer injectParameterWith:@"randomString"];
}];
}
I've set a breakpoint in initWithString
and it never gets called. Furthermore, the string when I'm trying to use it, the string is empty.
And yes, I've specified the Typhoon configuration in my plist file, I've also made sure this method is called, and it is.
Injection to AppDelegate<UIApplicationDelegate>
is a special case and only property or method injection is supported. This is because the AppDelegate is created outside of Typhoon.
Similarly objects created by Storyboards (Typhoon storyboard integration) only support property and method injection, not initializer injection.