1

我嘗試從一個細節視圖推送到另一個視圖。我在detailView「ConRDPDetailViewController」中有一個tableView,當我點擊一行時,推送新視圖「BookmarkEditorController」,我會喜歡它。 這是我在「ConRDPDetailViewController」的方法,我試着這樣做:主細節uisplitViewcontroller和uinavigationcontroller視圖

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
     { 
       ComputerBookmark* bookmark = nil; 
      if([indexPath section] == SECTION_BOOKMARKS) 
      { 
        // first row has either quick connect or add bookmark item 
        if([indexPath row] == 0) 
        { 

        // show add bookmark controller: is there I try to push the new View 
        BookmarkEditorController* bookmarkEditorController = [[[BookmarkEditorController alloc] initWithBookmark:[[ComputerBookmark alloc] initWithBaseDefaultParameters]] autorelease]; 
        [bookmarkEditorController setTitle:NSLocalizedString(@"Ajouter Connexion", @"Add Connection title")]; 
         UINavigationController *view = [[UINavigationController alloc] initWithRootViewController:bookmarkEditorController]; 

        [view.navigationController pushViewController:bookmarkEditorController animated:YES]; 
        [bookmarkEditorController setDelegate:self]; 

        [bookmarkEditorController setHidesBottomBarWhenPushed:YES]; 



        } 


      } 
    } 

但沒有什麼是發生的,這裏是我的AppDelegate.m方法didFinishLaunchingWithOptions

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    [self redirectConsoleLogToDocumentFolder]; 




    // Initialize the app window 
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 
    AuthentificationViewController *authentificationViewController =[[AuthentificationViewController alloc] initWithNibName:@"AuthentificationView" bundle:nil]; 
    //self.window.rootViewController = self.splitViewController; 
    self.window.rootViewController = authentificationViewController; 
     [self.window makeKeyAndVisible]; 

    // The new popover look for split views was added in iOS 5.1. 
    // This checks if the setting to enable it is available and 
    // sets it to YES if so. 
    // if ([self.splitViewController respondsToSelector:@selector(setPresentsWithGesture:)]) 
    // [self.splitViewController setPresentsWithGesture:YES]; 


    return YES; 
} 

預先感謝您

+1

只要你知道:這是「驗證」。不意味着成爲一個拼寫納粹:) – Undo 2013-04-09 14:47:32

+0

@Erway Softaware這是明智地完成「身份驗證」是法語,而不是英文,我知道英文的「身份驗證」是「身份驗證」。否則,感謝您的評論,但我懷疑它是否存在我的問題。 – Pis 2013-04-09 14:58:13

+0

對不起。不知道這是法國人。 – Undo 2013-04-09 14:58:55

回答

2

您需要將表格視圖控制器嵌入到導航控制器中。

然後你可以用這個代碼推詳細視圖:

BookmarkEditorController* bookmarkEditorController = [[[BookmarkEditorController alloc] initWithBookmark:[[ComputerBookmark alloc] initWithBaseDefaultParameters]] autorelease]; 
[bookmarkEditorController setTitle:NSLocalizedString(@"Ajouter Connexion", @"Add Connection title")]; 
[self.navigationController pushViewController:bookmarkEditorController animated:YES]; 
[bookmarkEditorController setDelegate:self]; 
[bookmarkEditorController setHidesBottomBarWhenPushed:YES]; 
+0

謝謝你的快速回答我曾嘗試過你的解決方案,但結果是相同的,沒有推動,更多[自我導航控制器]爲空。爲什麼?? – Pis 2013-04-09 15:06:15

+0

我不能將表格視圖控制器嵌入到導航控制器中,當我嘗試通過「菜單選擇」編輯器「/」嵌入到「/」導航控制器中時,選項被禁用。 ? – Pis 2013-04-09 15:21:58

+0

它可以在故事板編輯器中嘗試手動添加導航控制器,並將表視圖控制器連接到它 – Felix 2013-04-09 21:15:56

相關問題