单个 iPhone 应用程序中有多少个 UINavigationController 对象?

发布于 2024-08-21 08:18:13 字数 177 浏览 4 评论 0原文

我认为我的设计问题之一是,当我应该只有一个 UINavigationController 和一个委托时,我却不断创建导航对象。这是正确的吗?

我并不担心样式偏好,但我正在寻找的答案更多是关于技术角度和管理多个视图控制器之间的导航。任何指示都非常感谢和认可。

我仍然认为我已经控制了 SDK,然后我又陷入困境。

I think one of my design problems is that I keep creating navigation objects when I should only have one UINavigationController and a delegate. Is that correct?

I not as concerned from a style-preference, but the answer I am looking for is more about the a technical perspective and managing the navigation among several view controllers. Any pointers are very much appreciated and recognized.

I continue to think that I have the SDK under control and then I struggle again.

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

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

发布评论

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

评论(1

仅此而已 2024-08-28 08:18:13

好吧……我正在重读 Apple 的开发文档,答案是“通常只有一份,但通常不止一份。”

iPhone 开发中心:iPhone 操作系统的视图控制器编程指南:简介

“将导航控制器包含在应用程序的主 nib 文件中是最有意义的。您可以在以下情况执行此操作:导航控制器本身为应用程序窗口提供主视图,或者在导航控制器为选项卡栏界面提供根视图的情况下,尽管您也可以从主 nib 文件(或任何其他 nib)加载独立或模态呈现的导航控制器。文件),这样做并不是最佳选择,在这些情况下,在使用时以编程方式创建导航控制器通常更容易。”

OK ... I am re-reading Apple's Dev Doc and the answer is 'usually only one, but quite often more than one.'

"iPhone Dev Center: View Controller Programming Guide for iPhone OS: Introduction"

"It makes the most sense to include navigation controllers in your application’s main nib file. You do this when the navigation controller itself provides the main view for your application’s window or in situations where the navigation controller provides the root view for a tab bar interface. Although you could also load standalone or modally presented navigation controllers from your main nib file (or any other nib file), doing so is not optimal. In those scenarios, it is usually easier to create the navigation controller programmatically at the point of use."

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