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

查看:185
本文介绍了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还提供了一个很好的撰写,了解他如何将Bonjour封装器整合在一起例如。

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天全站免登陆