gpt4 book ai didi

objective-c - 如何用 UINavigationController 包装 UITableView?

转载 作者:行者123 更新时间:2023-11-28 23:16:40 25 4
gpt4 key购买 nike

我是 iPhone 开发的新手,我在尝试实现 UINavigationController 时遇到了麻烦。

我已经通过以下方式实现了 ViewController:

@interface FirstViewController : UITableViewController <UIActionSheetDelegate> {

IBOutlet UITableView *table;

/* added later but it dont know what to do to show it first*/
IBOutlet UINavigationController *navigationController;
}

@end

enter image description here

这个 TableView 效果很好。但是我想环绕导航 Controller 以便能够在单击行后显示下一个 View 。我不明白我应该如何处理 NIB 文件的问题。我已将 UIViewController 拖放到那里 - 但我无法将其设置为 View 。因为我无法将连接从文件所有者的 View 拖到 UIViewController。我应该怎么做才能使它看起来像导航中的表格,而不是普通表格。

最佳答案

UINavigationViewController 将拥有 UITableViewController。因此,AppDelegate 将设置 UINavigationViewController,然后堆栈的顶部将开始作为您的 TableView Controller 。

关于objective-c - 如何用 UINavigationController 包装 UITableView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6084882/

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