TTURLMap 中的参数?
我有一个类似 Facebook 的主屏幕。 对于我的 SettingsViewController,我需要在整个方法中为我的委托传递一个对象。
如何做到这一点?
到目前为止,这是我的代码:
TTURLMap* map = navigator.URLMap;
[map from: @"tt://einstellungen"
parent: @"tt://launcher"
toViewController: [SettingsViewController class]
selector: nil
transition: trans];
NSMutableArray *array = [NSMutableArray arrayWithObjects:
[self launcherItemWithTitle:@"Einstellungen"
image:@"bundle://animexx-72.png"
URL:@"tt://einstellungen"]
, nil];
launcherView.pages = [NSArray arrayWithObjects:
array
, nil];
通常我会:
SettingsViewController *controller = [SettingsViewController alloc] init];
controller.delegate = self;
如何在这里拥有这个?
I have a Facebook-Like MainScreen.
For my SettingsViewController I need to pass a object for my delegate throughout the method.
How to do this?
Here is my code until now:
TTURLMap* map = navigator.URLMap;
[map from: @"tt://einstellungen"
parent: @"tt://launcher"
toViewController: [SettingsViewController class]
selector: nil
transition: trans];
NSMutableArray *array = [NSMutableArray arrayWithObjects:
[self launcherItemWithTitle:@"Einstellungen"
image:@"bundle://animexx-72.png"
URL:@"tt://einstellungen"]
, nil];
launcherView.pages = [NSArray arrayWithObjects:
array
, nil];
Normaly I would have:
SettingsViewController *controller = [SettingsViewController alloc] init];
controller.delegate = self;
How to have this here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您需要控制器作为对象,您可以初始化它并使用 TTURLMap 中的对象引用:
If you need the controller as an object, you can initialize it and use the object reference in the TTURLMap: