ios - TyphoonStoryboard problems -
i'm trying instantiateinitial viewcontrollers manually , stuck next thing.
this working:
-(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 1 not working:
-(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 crashes with: [__nsarraym insertobject:atindex:]: object cannot nil
oops.. sorry, factory definition
runtime argument not supported in typhoon. but.. we've added feature you!
check typhoon 3.1.9
version, code should work fine now.
Comments
Post a Comment