I'm using typhoon with 'Plist integration'
I've defined the AppDelegate as follows inside an assembly:
- (AppDelegate *)appDelegate {
return [TyphoonDefinition withClass:[AppDelegate class] configuration:^(TyphoonDefinition *definition) {
[definition injectProperty:@selector(window)];
definition.scope = TyphoonScopeSingleton;
}];
}
Inside window, I have a rootViewController with a delegate that it's implemented by AppDelegate.
- (RootViewController *)rootViewController {
return [TyphoonDefinition withClass:[RootViewController class] configuration:^(TyphoonDefinition *definition) {
[definition injectProperty:@selector(delegate)];
}];
}
The problem is that the delegate is set with another instance of AppDeleaate. I've set a breakpoint inside the AppDelegate init and indeed it's called twice.
I know that a solution would be to manually set the delegate inside the AppDelegate during runtime, but I would like this to be handled by typhoon.
Note: I haven't tried it but this same thing may happen with view controllers created by storyboards.