如何将 UITableViewController 添加到 XCode4 中 UITabViewController 上的 UINavigationController?

发布于 2024-12-11 12:05:11 字数 396 浏览 0 评论 0原文

我正在 http://www.youtube.com/watch?v=LBnPfAtswgw 并能够在 XCode 3 中复制它,但是在 XCode 4 中我遇到了一些问题。

我的应用程序的根视图控制器是一个 UITabBarController,我在其中选择了一个选项卡并选择了一个 UINavigationController,然后按照教程的建议拖动了一个视图,但无法选择我的 UITableViewController 类?

我也没有看到其中说选择选项卡栏控制器并选择 UINavigation 控制器的部分(大约 9:08)

任何人都可以指导我我做错了什么吗?

I was following this tutorial on http://www.youtube.com/watch?v=LBnPfAtswgw and was able to replicate that in XCode 3 however with XCode 4 I am having some issues.

My app's root view controller is a UITabBarController on which I selected one of the tabs and selected a UINavigationController and then dragged a view as the tutorial suggests but am unable to select my UITableViewController class?

I also do not see a section where it says to select a tab bar controller and select the UINavigation controller (around 9:08)

Can anyone guide me as to what I am doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海螺姑娘 2024-12-18 12:05:11

您可以使用以下代码执行相同的操作:

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
TablelViewController *viewController1 = [[TablelViewController alloc] initWithNibName:@"TablelViewController" bundle:nil];
UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:viewController1];

TableViewController2 *viewController2 = [[TableViewController2 alloc] initWithNibName:@"TableViewController2" bundle:nil];
UINavigationController *navigationController2 = [[UINavigationController alloc] initWithRootViewController:viewController2];

self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationController1, navigationController2, nil];

self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];

此代码如下:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

You can do the same by using the following code:

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
TablelViewController *viewController1 = [[TablelViewController alloc] initWithNibName:@"TablelViewController" bundle:nil];
UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:viewController1];

TableViewController2 *viewController2 = [[TableViewController2 alloc] initWithNibName:@"TableViewController2" bundle:nil];
UINavigationController *navigationController2 = [[UINavigationController alloc] initWithRootViewController:viewController2];

self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationController1, navigationController2, nil];

self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];

This code goes in:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文