ios - 主细节 uisplitViewController 和 UINavigationController View

标签 ios objective-c uinavigationcontroller uisplitviewcontroller

我尝试从详细 View 推送到另一个 View 。我在 detailView“ConRDPDetailViewController”中有一个 tableView,当我单击一行时我会喜欢它,它会推送新 View “BookmarkEditorController”。 这是我在“ConRDPDetailViewController”中尝试这样做的方法:

- (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;
}

提前致谢

最佳答案

您需要将 TableView Controller 嵌入到导航 Controller 中。

然后您可以使用此代码推送详细 View :

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];

关于ios - 主细节 uisplitViewController 和 UINavigationController View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15905058/

相关文章:

ios - SwiftUI:拖动逻辑错误或者这是一个错误?

objective-c - setImage:不会导致图像更改

swift - 使用 Swift 以编程方式设置 UINavigationController 的 UINavigationBar

ios - 在 iPhone 上安装 Facebook 应用程序时,Facebook 登录失败

Objective-C,C 多个等号在一个 if

ios - 导航 Controller 左边缘滑动和后退按钮行为之间的差异

ios - 发布更改导航栏图像?

ios - 如何告诉 tesseract 不要忽略单词之间的空格?

ios - 从图库中获取图像很慢

ios - 如何在 iOS 中为通用应用程序创建通用 Storyboard?