TyphoonStoryboard issues
I am trying to instantiate the Initial viewControllers manually and stick with the following thing.
It works:
-(TyphoonStoryboard *)storyboard {
return [TyphoonDefinition withClass:[TyphoonStoryboard class] configuration:^(TyphoonDefinition* definition) {
[definition useInitializer:@selector(storyboardWithName:factory:bundle:) parameters:^(TyphoonMethod *initializer) {
[initializer injectParameterWith:@"Diary"];
[initializer injectParameterWith:self];
[initializer injectParameterWith:[NSBundle mainBundle]];
}];
definition.scope = TyphoonScopeSingleton;
}];
}
-(LADiaryMainViewController *)mainViewController {
return [TyphoonDefinition withFactory:[self storyboard] selector:@selector(instantiateInitialViewController)];
}
and this one doesn't work:
-(TyphoonStoryboard *)storyboardWithName:(NSString *)name {
return [TyphoonDefinition withClass:[TyphoonStoryboard class] configuration:^(TyphoonDefinition* definition) {
[definition useInitializer:@selector(storyboardWithName:factory:bundle:) parameters:^(TyphoonMethod *initializer) {
[initializer injectParameterWith:name];
[initializer injectParameterWith:self];
[initializer injectParameterWith:[NSBundle mainBundle]];
}];
}];
}
-(LADiaryMainViewController *)mainViewController {
return [TyphoonDefinition withFactory:[self storyboardWithName:@"Diary"] selector:@selector(instantiateInitialViewController)];
}
Second way is crashing: [__NSArrayM insertObject:atIndex:]: object cannot be nil
+3
source to share