gpt4 book ai didi

iphone - 从 tableviewcontroller 推送时的黑色背景

转载 作者:行者123 更新时间:2023-11-29 13:35:12 25 4
gpt4 key购买 nike

我有一个选项卡 View Controller ,其中包含一个 TableView Controller 。当您按下表格行时,它会打开另一个 tableviewcontroller(如 detailtableviewcontroller)....我在右上角有一个导航按钮,如“添加”或“+”。我想在按下 + 按钮时加载一个 View Controller ,但每次按下它时, View Controller 只是一个黑色背景

AddSeasonViewController *stvc = [[AddSeasonViewController alloc] init];
//[self presentModalViewController:stvc animated:YES];
[self.navigationController pushViewController:stvc animated:YES];

[stvc release];

以上代码摘自detailTableViewController

感谢任何帮助,提前致谢!

最佳答案

看起来你没有正确初始化 viewController

AddSeasonViewController *viewController = [[AddSeasonViewController alloc] initWithNibName:@"AddSeasonViewController" bundle:nil];

-->if you have a UINavigationController assigned in the UItabBarController, you can use this

[self.navigationController pushViewController:viewController animated:YES];

-->I think in your case you are simply adding a viewController to the UITabBarController, then pushViewController will not work

[self presentModalViewController:viewController animated:YES];
[stvc release];

关于iphone - 从 tableviewcontroller 推送时的黑色背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10752778/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com