Ios 主详细信息uisplitViewController和UINavigationController视图
我尝试从一个细节视图推送到另一个视图。我在detailView“ConRDPDetailViewController”中有一个tableView,当我单击一行时,我会喜欢它,它会推送新视图“BookmarkEditorController”。 以下是我在“ConRDPDetailViewController”中尝试的方法:Ios 主详细信息uisplitViewController和UINavigationController视图,ios,objective-c,uinavigationcontroller,uisplitviewcontroller,Ios,Objective C,Uinavigationcontroller,Uisplitviewcontroller,我尝试从一个细节视图推送到另一个视图。我在detailView“ConRDPDetailViewController”中有一个tableView,当我单击一行时,我会喜欢它,它会推送新视图“BookmarkEditorController”。 以下是我在“ConRDPDetailViewController”中尝试的方法: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)index
- (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中使用选项完成启动
- (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;
}
提前感谢您需要将表视图控制器嵌入导航控制器中 然后可以使用以下代码推送详图视图:
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];
正如你所知:这是“身份验证”。我不想成为拼写纳粹:)@Erway Softaware这是故意做的“Authentication”是法语而不是英语,我知道英语中的“Authentication”是“Authentication”。否则,谢谢你的评论,但我怀疑这是我的问题。对不起。我不知道是法语。万一有人来这里用Swift和iOS8寻找解决方案-谢谢你的快速回答我以前尝试过你的解决方案,但结果是一样的,没有推送,更多的[self-navigationcontroller]为空。为什么?我无法在导航控制器中嵌入表视图控制器,因为当我尝试通过“菜单选择”编辑器“/“嵌入”/“导航控制器”时,选项被禁用“。有可能通过编程实现吗???在情节提要编辑器中也有可能。尝试手动添加导航控制器并将“表视图”控制器连接到它。请给我一个添加程序的示例“我是一个导航控制器并将其连接到“表视图”??提前谢谢