TTURLMap中的参数?

时间:2011-08-30 15:09:10

标签: iphone delegates three20

我有一个像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];   

Normaly我会:

SettingsViewController *controller = [SettingsViewController alloc] init];
controller.delegate = self;

如何在这里有这个?

1 个答案:

答案 0 :(得分:1)

如果您需要将控制器作为对象,您可以初始化它并使用TTURLMap中的对象引用:

 SettingsViewController* controller = [[SettingsViewController alloc] init];
 controller.delegate = self;


 [map            from: @"tt://einstellungen"
              parent: @"tt://launcher"
    toViewController: controller
            selector: nil
          transition: trans];