iPhone 如何设置新设计、多个 XIB?

发布于 2024-11-06 05:41:49 字数 291 浏览 0 评论 0原文

我正在将 Android Java 应用程序转换(同时尝试并学习)到 iPhone。我已经为大多数部分制作了测试场景,以确保我知道如何继续,并且我已经接近实际开始。

该应用程序从主菜单启动,然后进入多个子菜单(大约 8 个)。大多数子菜单都会转到执行操作(例如数据显示或编辑)的单个屏幕。

我已经开始使用导航控制器和一个 XIB 上的所有视图来构建原型。现在的问题是我是否为每个子菜单创建另一个 XIB,并且每个子菜单都有视图,或者什么?我还没有找到一篇文章来解释内存管理以及推荐的方法是什么。

感谢您的任何想法和想法!

I am converting (trying to and learning at the same time) a Android Java app to iPhone. I have made test scenarios for most of the sections to make sure I have an idea how to proceed and I am getting close to actually starting.

The app starts on a main menu and from there goes to multiple sub menus (about 8 of them). Most of the sub menus goes to a single screen that performs an action, like data display or editing.

I have started the prototype with a Nav Controller and all the views on one XIB. Now the question is do I create another XIB for each of the sub menus and each of those would have views, or what? I have yet to find one article that explains the memory management and what the recommended way to do this is.

Thanks for any ideas and thoughts!

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

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

发布评论

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

评论(1

楠木可依 2024-11-13 05:41:49

将不同部分分成多个 XIB 文件的原因有两个:

  1. 如果用户没有转到应用程序的每个部分(例如,他们只选择第一个子菜单),则只需加载所需的 XIB 文件,从而减少内存您的应用程序的足迹。这通常不是一个太大的问题,除非您的 XIB 中有很多的内容,但是节省使用内存总是更好,因为您不知道用户的情况。
  2. 当所有内容都分成不同的文件时,您可以更好地组织它们。这部分完全取决于您,以及您是否喜欢将所有内容放在一个地方,或者分成几类。

基本上,对于大多数应用程序来说,选择哪个方向并不重要。做任何对你有用的事情。通常建议将视图控制器使用的视图拆分到不同的文件中(Xcode 很多时候会自动执行此操作)。视图控制器会为您延迟加载额外的 XIB 文件(您只需设置视图控制器的NIB Name),因此根本不需要太多努力。

The reason you separate different sections into multiple XIB files is twofold:

  1. If the user doesn't go to each section of your app (they only select the first submenu, for example), only the needed XIB files have to loaded, reducing the memory footprint of your application. This generally isn't too much of an issue, unless you have a lot of things in your XIB, but it's always better to use memory sparingly because you don't know the users situation.
  2. When everything is split up into different files, you can potentially organize it better. This part is completely up to you, and whether you like to have everything in one place, or broken up into categories.

Basically, it doesn't matter too much for most applications which direction you go. Do whatever works for you. It is generally recommended to split the views used by view controllers out into different files (Xcode does this automatically a lot of the time). The view controllers do the lazy-loading of the additional XIB files for you (you just have to set the NIB Name of the view controller), so it doesn't take much effort at all.

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