CFNetwork 和 Bonjour 集成,用于 iPhone 到 Mac 的集成 [英] CFNetwork and Bonjour integration for iPhone to Mac integration

查看:26
本文介绍了CFNetwork 和 Bonjour 集成,用于 iPhone 到 Mac 的集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想结合使用 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?

谢谢!

推荐答案

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

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.

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

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.

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

这篇关于CFNetwork 和 Bonjour 集成,用于 iPhone 到 Mac 的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆