通过wifi在2个iPhone之间传输文件? [英] Transfer files between 2 iPhones over wifi?

查看:308
本文介绍了通过wifi在2个iPhone之间传输文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了几天时间寻找不同的解决方案,但是整个领域都非常复杂,我想知道是否有人知道我可以通过wifi简单地传输NSData或NSString或其他一些简单文件的任何项目到网络上的另一部iPhone?

I've spent a few days looking for different solutions, but the whole area is quite complicated, and I'm wondering if anybody knows of any project where I can simply transfer NSData or an NSString or some other simple file over wifi to another iPhone on the network?

推荐答案

Np。使用bonjour搜索设备。然后使用 CocoaAsyncSocket 发送和接收数据。它就像一个魅力。

Np. Use bonjour to search for devices. Then use CocoaAsyncSocket to send and receive data. It works like a charm.

关于AsyncSock的小信息:

Little info about AsyncSock:


GCDAsyncSocket和AsyncSocket是TCP / IP套接字网络图书馆。
以下是两者中可用的主要功能:

GCDAsyncSocket and AsyncSocket are TCP/IP socket networking libraries. Here are the key features available in both:

原生目标-c,完全自包含在一个类中。无需使用套接字或流来捣乱
。这个类为你处理一切。

Native objective-c, fully self-contained in one class. No need to muck around with sockets or streams. This class handles everything for you.

完全代表支持错误,连接,读取完成,写入
完成,进度和断开连接都会导致对你的调用
委托方法。

Full delegate support Errors, connections, read completions, write completions, progress, and disconnections all result in a call to your delegate method.

排队的非阻塞读写,带有可选的超时。你告诉
它要读什么或写什么,它会为你处理一切。排队,
缓冲,并在流中搜索终止序列 -
全部为您自动处理。

Queued non-blocking reads and writes, with optional timeouts. You tell it what to read or write, and it handles everything for you. Queueing, buffering, and searching for termination sequences within the stream - all handled for you automatically.

自动套接字接受。旋转一个服务器套接字,告诉它
接受连接,它将为你调用每个连接的新实例

Automatic socket acceptance. Spin up a server socket, tell it to accept connections, and it will call you with new instances of itself for each connection.

支持用于IPv4和IPv6上的TCP流。自动连接到
IPv4或IPv6主机。使用此类的单个实例自动接受超过
IPv4和IPv6的传入连接。没有多少
担心多个套接字。

Support for TCP streams over IPv4 and IPv6. Automatically connect to IPv4 or IPv6 hosts. Automatically accept incoming connections over both IPv4 and IPv6 with a single instance of this class. No more worrying about multiple sockets.

支持TLS / SSL使用一个
方法调用轻松保护套接字。可用于客户端和服务器套接字。

Support for TLS / SSL Secure your socket with ease using just a single method call. Available for both client and server sockets.

这篇关于通过wifi在2个iPhone之间传输文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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