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

相关问题