Mac Cocoa MainWindow mvc?

发布于 2024-12-09 10:48:35 字数 314 浏览 2 评论 0原文

我已经是 iphone 程序员一段时间了,现在我正在尝试为 mac 写一些东西。 我的第一个认知失调 - 是苹果谈论了很多 MVC,并且我在我的 iPhone 应用程序中成功地使用了 MVC 范例,但我不明白如何在最简单的 Mac 应用程序中实现它。 我读过的每本书都说我必须将 gui 元素从 MainWindow.nib 绑定​​到 MyAppDelegate。 MVC 范式到底在哪里?我真的很想知道,如何使用 MainWinow.nib、MainWindowController 和 MainVindow 类文件制作最简单的 mac 应用程序。以及如何以编程方式从 MyAppDelegate 显示该窗口。

I'm some time already iphone programmer, and now i'm try to write something for mac.
My first cognitive dissonance - is that apple talk lot about MVC, and i'm successfully use mvc paradigm in my iphone apps, but i do not understand how to implement it in simplest mac app.
Every book i'm read, say that i must bind gui elements from MainWindow.nib to MyAppDelegate. Where the hell is MVC paradigm here? I'm really whant to know, how to make simplest mac app with: MainWinow.nib, MainWindowController and MainVindow class file. And how to programmically show thos window from MyAppDelegate.

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

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

发布评论

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

评论(1

装迷糊 2024-12-16 10:48:35

查看其实际效果的最简单方法是启动一个新的 Mac OS X 项目 -->可可的应用。这将为简单的单窗口 Mac 应用程序提供一个框架。

您的问题可能涉及绑定,这是一项直接将模型对象连接到 UI 的 Mac 技术。绑定可以消除大量控制器代码;但是有很多应用程序根本不使用绑定 - 并且了解技术对于理解简单的单窗口应用程序的琐碎情况并不重要。

The easiest way to see it in action is to simply start a new Mac OS X project --> Cocoa application. That will provide a framework for a simple single-window Mac application.

Your question may be referring to bindings which is a Mac technology that directly connects model objects to the UI. Bindings can eliminate a lot of controller code; but there are plenty of applications out there that do not use bindings at all - and understanding that technology isn't crucial to understanding the trivial case of a simple single-window application.

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