【发布时间】:2017-10-20 08:52:44
【问题描述】:
我一直在尝试很多东西,要列出很多。我正在使用此代码从情节提要视图控制器转到 XIB 视图控制器:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 2) {
if (indexPath.row == 1) {
BLoginViewController *viewController=[[BLoginViewController alloc]initWithNibName:@"BLoginViewController" bundle:nil];
[self presentViewController:viewController animated:YES completion:nil];
}
}
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}
问题是,一旦加载了 XIB 视图控制器,我就无法返回情节提要!
我添加了一个工具栏,上面有一个名为“关闭”的工具栏按钮。我将“关闭”按钮与 XIB 的 viewcontroller.h 文件连接,并将@synthesize closeButton; 添加到 XIB 的 viewcontroller.m 文件中,然后在 XIB 的 viewcontroller.m 文件中添加类似的内容并将其链接到“关闭”工具栏按钮:
- (IBAction)closeButtonPressed:(id)sender {
}
我不知道在“关闭”按钮中放入什么代码以使其返回到最初的故事板视图控制器。
任何帮助将不胜感激。
【问题讨论】:
-
-
当我使用dismissView控制器时,它会隐藏“BLoginViewController”一秒钟,我看到一个不同的XIB视图控制器连接在它后面,然后“BLoginViewController”立即弹出。它不会回到故事板。
-
您能否发布您的导航流程,以便我可以更好地帮助您
标签: ios objective-c iphone xcode uiviewcontroller