CFNetwork 和 Bonjour 集成,用于 iPhone 到 Mac 的集成

发布于 2024-09-09 00:08:24 字数 210 浏览 2 评论 0原文

我想结合使用 CFNetwork 和 Bonjour,以便能够在我的 iPhone 应用程序和 Mac 应用程序之间进行通信。 iPhone 上的应用程序只有一个按钮。然后在Mac应用程序上,就会有一个标签。如果在 iPhone 应用程序上按下按钮,则 Mac 应用程序上的标签会发生变化。

有没有可以做到这一点的示例代码?如果没有,有人可以引导我走向正确的方向吗?

谢谢!

I want to use CFNetwork and Bonjour in conjunction to be able to have communications between my iPhone app and a Mac app. The app on the iPhone would have one button. Then on the Mac app, there will be a label. If the button is pushed on the iPhone app, the label changes on the Mac app.

Is there example code out there that can do this? If not, can someone lead me in the right direction?

Thanks!

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

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

发布评论

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

评论(2

浅暮の光 2024-09-16 00:08:24

Bill Dudney 创建了一个示例 iPhone Bonjour 应用程序来演示如何使用 Bonjour发现并连接到两部 iPhone。我将此示例移植到 Mac 来演示如何进行 Bonjour 发现两个平台之间。 Bill 还提供了一篇很好的文章,介绍了他如何将 Bonjour 包装器组合在一起这个例子。

这是一个非常简单的示例,对于 Mac 和 iPhone 客户端,它会执行与您想要的类似的操作。只需要进行较小的修改。

我在我的 iTunes U 上的高级 iPhone 开发课程

Bill Dudney created a sample iPhone Bonjour application to demonstrate how to use Bonjour to discover and connect to two iPhones. I ported this example to the Mac to demonstrate how to do Bonjour discovery between the two platforms. Bill also provides a nice writeup of how he put together the Bonjour wrapper used in this example.

This is a very simple example, and with the Mac and iPhone clients it does something similar to what you want. Only minor modifications should be needed.

I show this in action in the video for the Networking session of my Advanced iPhone Development course on iTunes U.

喜你已久 2024-09-16 00:08:24

在这里,我创建了一些简单的示例应用程序,用于在 iPhone 和 iMAC 之间交换数据。

https://github.com/boobalaninfo/Bonjour-iOS-MAC-Apps

Here i have created some simple sample application which exchange the data between iPhone and iMAC.

https://github.com/boobalaninfo/Bonjour-iOS-MAC-Apps

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