最好的方式与mac沟通iphone? [英] Best way to communicate iphone with mac?

查看:145
本文介绍了最好的方式与mac沟通iphone?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些应用程序在控制在我的Mac从iPhone的东西。可能最简单的事情是让iPhone模拟键盘,然后处理mac上的键事件。

I have some apps in mind to control things in my Mac from the iPhone. Probably the simplest thing to do would be to make the iPhone simulate a keyboard and then handle key events on the mac.

你认为这是最好的沟通方式iphone与mac?我可以使用GameKit吗? HTTP?

What do you think it's the best way to communicate iphone with the mac? Can I use GameKit for that? HTTP?

推荐答案

您不能使用GameKit,因为该框架不存在于Mac上。这样做的方法是使用NSNetService和NSNetServiceBrowser,它封装使用Bonjour自动发现可用的连接。我将查看示例代码(Bonjour Web,CocoaEcho和其他)以帮助您开始。

You can't use GameKit, because that framework is not present on the Mac. The way to do this is using NSNetService and NSNetServiceBrowser, which encapsulate using Bonjour to autodiscover available connections. I'd check out the sample code ("Bonjour Web", "CocoaEcho", and others) to help you get started.

但请注意,这些类看起来足够开心,但可以是无尽的沮丧的源泉。 (他们是为我)

Be aware, though, that these classes look pleasant enough at first, but can be the source of endless frustration. (They were for me)

这篇关于最好的方式与mac沟通iphone?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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