gpt4 book ai didi

ios - 台风 Storyboard问题

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:14:44 26 4
gpt4 key购买 nike

我正在尝试手动实例化 Initial viewControllers 并坚持下一步。

这是有效的:

-(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)];
}

这个不行:

-(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)];
}

第二种方法是崩溃:[__NSArrayM insertObject:atIndex:]: object cannot be nil

最佳答案

糟糕.. 抱歉,台风不支持带有运行时参数的工厂定义。但是..我们已经为您添加了该功能!

检查 Typhoon 3.1.9 版本,您的代码现在应该可以正常工作了。

关于ios - 台风 Storyboard问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30759155/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com