0

こんにちは私はthree20の初心者です。「SettingsViewControllersetOriginalNavigatorURL認識されないセレクターが送信されました」という例外が発生します。アプリにすでにナビゲーションコントローラーがある場合、TTLauncherViewを使用するにはどうすればよいですか?

UINavigationController内にUITableViewControllerがあります。テーブルで「設定」の行が選択されているときにランチャーを起動したい。以下は私がしたことです:

- (void)tableView:(UITableView *)tableView 
        didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch ([indexPath row]){
      case 0:
        [self launchSettings];
        break;
    // ....
}

-(void)launchSettings
{

    TTNavigator* navigator = [TTNavigator navigator];
    navigator.persistenceMode = TTNavigatorPersistenceModeAll;
    TTURLMap* map = navigator.URLMap;
    [map from:@"*" toViewController:[TTWebController class]];
    [map from:@"tt://launcher/" toViewController:
     [SettingsViewController class]];


    if (![navigator restoreViewControllers]) {
        [navigator openURLAction:
         [TTURLAction actionWithURLPath:@"tt://launcher"]];
    }   
    [self presentModalViewController:[navigator openURLAction:
                                  [TTURLAction actionWithURLPath:@"tt://launcher"]] animated:YES];
}

TTLauncherViewを作成し、それをサブビューとしてSettingsViewControllerに追加したloadViewを備えたSettingsViewController:UIViewControllerがあります。

- (void)loadView {
    [super loadView];
    TTLauncherView* launcherView = [[TTLauncherView alloc]
                                    initWithFrame:self.view.bounds];
    launcherView.backgroundColor = [UIColor blackColor];
    launcherView.columnCount = 4;
    launcherView.pages = [NSArray arrayWithObjects:
                          [NSArray arrayWithObjects:
                           [self launcherItemWithTitle:@"Google"
                                 image:@"bundle://safari_logo.png"
                                 URL:@"http://google.com"],
                           [self launcherItemWithTitle:@"Apple"
                                 image:@"bundle://safari_logo.png"
                                 URL:@"http://apple.com"]
                           , nil]
                          , nil];

    [self.view addSubview:launcherView];
    [launcherView release];
}

- (TTLauncherItem *)launcherItemWithTitle:(NSString *)pTitle
                       image:(NSString *)image URL:(NSString *)url {
    TTLauncherItem *launcherItem = [[TTLauncherItem alloc]
                       initWithTitle:pTitle
                       image:image
                       URL:url canDelete:YES];
    return [launcherItem autorelease];
}
4

2 に答える 2

0

-ObjC -all_load が他のコンパイラ フラグにありませんでした。これらは、three20 を使用するために必要です。http://three20.info/article/2010-10-06-Adding-Three20-To-Your-Projectを参照してください

于 2011-06-13T15:55:13.190 に答える
0

構文エラー?

 switch ([indexPath row]){
  case 0:
    launchSettings;  -> [self launchSettings];
    break;
于 2011-04-25T15:58:47.237 に答える