iPhone 开发 - 使用多个视图/xib/nib 的复杂应用程序

发布于 2024-07-11 03:25:00 字数 1129 浏览 7 评论 0原文

我是 iPhone 开发新手,多个视图(xib 或 nib)真的让我感到困惑。 这就是我想要实现的目标...

  1. 使用选项卡栏查看(选项卡 1、选项卡 2、选项卡 3)
  2. 选项卡 2 视图(导航控制器) 2.1 选择表格行将显示包含单元格详细信息的视图 2.2 导航栏上的添加按钮将显示一系列视图界面以获取不同类型的信息(例如位置信息、个人信息等) - 需要这是连续的,不能为此使用控制段。 成功收集信息后,在选项卡 2 查看表中创建一个新单元格,将相关信息保存到自定义结构,并显示带有 2 个选项的完成页面(添加另一个、查看添加的项目 - 只读视图)

我很困惑如何处理这些多个视图(将它们链接在一起,并来回传达信息)。 所有这些将由我的应用程序委托类处理还是我可以/应该使用多个委托类? 无论哪种方式,你都能为我指明正确的方向 - 可能是一些示例应用程序或教程,解释如何处理这样的或更复杂的情况。

在这方面的任何帮助将受到高度赞赏。


我已经看过 TheElements 和 SeismicXML 示例。

Elements 示例代码提供了如何使用 UITabBarControllerUINavigationController 的基本概念,但该示例未讨论从子控制器向父控制器传递信息。

就我而言,我有一个 UITabBarController,其中一个选项卡显示一个 UINavigationController,右上角或导航栏上带有 (+)。 现在(+)将打开一个用户输入界面,该输入将用于存储数据(例如在sql中),并在嵌入UINavigationControllerUITableView中创建一个新的表格单元格代码>. 现在,使用 (+) 打开的界面将按照一系列步骤(例如“主要”>“步骤 1”>“步骤 2”>“完成”)接受用户输入。 每个步骤都会显示一个单独的视图。 我很难尝试设计这个模型。 或者,也许我不习惯在 Cocoa/iPhone 中编程,而且我看不太清楚。 当涉及到涉及 20-30 个字段(文本、列表、日期、图像等)的用户输入时,我还有什么其他选择。 您能否就此提供一些意见?

感谢您的帮助。

I'm new to iPhone development, and multiple views (xib or nib) are really confusing me. This is what i'm trying to achieve...

  1. View with Tab Bar (Tab 1, Tab 2, Tab 3)
  2. Tab 2 View (Navigation Controller)
    2.1 Selecting Table Row will show a View with cell details
    2.2 Add button on the navigation bar will show a series of view interfaces to get different type of information (e.g. Location Information, Personal Information, etc) - Need this to be sequential, can't use control segment for this. Once information is successfully gathered, create a new cell in Tab 2 View Table, Save related information to a custom structure, and show a completion page with 2 options (Add another, View added item - readonly view)

I'm confused about how to handle these multiple views (both linking them together, and communicating information back and forth). Will all these be handled by my application delegate class or i can/should use multiple delegate classes? Either way can you point me in the right direction - possibly some sample application or tutorial explaining how to handle situation like this or more complex.

Any help in this regard will be highly appreciated.


I have seen both TheElements and SeismicXML examples.

TheElements sample code gives a basic idea of how to use UITabBarController, and UINavigationController, but the example does not discuss passing information from Child Controller to Parent.

In my case, I have a UITabBarController, one of the Tab shows a UINavigationController with (+) on the top right corner or Navigation Bar. Now (+) will open an interface for user input and that input will be used to store the data (say in sql), and create a new Table Cell in UITableView embedded in UINavigationController. Now, the interface that will open using (+) will take user input following a sequence of steps (like Main > Step 1 > Step 2> Complete). Each step will show a separate view. I'm getting hard time trying to design this model. Or, maybe I'm not used to programming in Cocoa/iPhone and I'm not looking straight. What other options do I have - when it comes to taking user input involving 20-30 fields (Text, List, Date, Image e.t.c.). Can you provide some input regarding this.

Thanks for your help.

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

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

发布评论

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

评论(2

怪我鬧 2024-07-18 03:25:00

也许此 Google 图书链接 可以帮助您创建多视图应用程序。

Perhaps this Google Books link can help you in creation of multiview applications.

柒七 2024-07-18 03:25:00

对于 iPhone,您需要处理大多数视图并使用相应的视图控制器进行切换。 对于您的情况,这些将是 UITabBarController 和 UINavigationController。 为了在用户自己的操作之外控制它们并根据需要存储数据,您可能需要考虑创建这些控制器自己的子类。 一些好的起点是 TheElements(涵盖选项卡栏和表格视图)和 SeismicXML(表格视图和导航控制器)。

大多数实际链接可以在 Interface Builder 中处理,您可以在其中创建和布局所有各种选项卡的内容,但您需要使用子类来提供数据(特别是在表视图的情况下,您可以在其中创建和布局所有选项卡的内容)。我需要为每个单元格设置数据)。

希望这有帮助,
杰夫

For the iPhone, you'll want to handle most views and switching between with the the respective view controllers. For your case, these would be the UITabBarController and UINavigationController. For the purposes of controlling them outside the user's own actions and for storing data, as you want, you'll probably need to look into creating your own subclasses of these controllers. Some good starting points would be the TheElements (which covers tab bars and table views) and SeismicXML (table views and navigation controllers).

Most of the actual linking can be handled in Interface Builder, where you can create and layout all the various tabs' contents, but you'll need to use your subclasses to provide data (especially in the case of the table view, where you'll need to setup the data for each cell).

Hope this helped,
Geoff

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