我的iPhone应用程序可以与连接的计算机通信吗? [英] Can my iphone app communicate with a connected computer?

查看:154
本文介绍了我的iPhone应用程序可以与连接的计算机通信吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最好是通过电缆连接的电脑,但如果有办法通过wifi做,这也将是有用的。我想知道是否可以在他们之间发送消息?

Preferably, this would be a computer connected via cable, but if there's a way to do it over wifi then this would also be useful. I'm wondering if it's possible to send messages between them?

或者如果我有一个mac应用程序和iPhone应用程序,我可以通过wifi或usb在他们之间沟通

Or if i had a mac app and an iPhone app, could I communicate between them over wifi or a usb connection, rather than using a server or something?

推荐答案

通过WiFi连接是可能的,但是电缆连接是不可能的

Connecting over WiFi is possible, cable connection however isn't possible (certainly not in the documented API) unless the phone is jailbroken.

对于wifi,您只需要连接到TCP / IP主机/套接字,查看 CocoaAsyncSocket 。计算机需要托管某种服务器软件。这是iTunes Remote和AirMouse的工作原理。

For wifi, you're just going to connect to a TCP/IP host/socket, have a look at CocoaAsyncSocket. The computer would need to be hosting some sort of server software. This is how iTunes Remote and AirMouse work.

这篇关于我的iPhone应用程序可以与连接的计算机通信吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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