从 CocoaAsyncSocket 开始 [英] Starting with CocoaAsyncSocket

查看:41
本文介绍了从 CocoaAsyncSocket 开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找通过 TCP 将文件(在 iphone 上录制的小声音)发送到服务器以及从服务器发送到其他设备的方法.似乎最简单的方法是使用 CocoaAsyncSocket 项目.(是真的吗?)

I've been looking for ways to send files (small sound recorded on the iphone) over TCP to a server and from the server to other devices. It seems like the easiest way to do so would be using the CocoaAsyncSocket project. (Is it true?)

然而,虽然我可以找到很多关于如何使用它的例子,但我找不到关于如何安装它的单一解释.

However, while I could find many examples on how to use it, I couldn't find a single explanation on how to install it.

我对 iOS 和 Xcode 比较陌生,对此非常迷茫.有人可以向我解释如何获得图书馆吗?(我知道如何将库添加到我的项目中,但是我只能通过 gitHub 找到 .m 文件的下载)

I'm relatively new to iOS and Xcode and quite lost in that. Could someone please explain to me how to get the library? (I know how to add a library to my project, however I only found download for the .m files thru the gitHub)

谢谢

推荐答案

这个库带有一个头文件(AsyncSocket.h 或 GCDAsyncSocket.h)和一个实现文件(AsyncSocket.m 或 GCDAsyncSocket.m).您只需要复制项目中的 .h 和 .m 即可.并使用#import 语句在您的类中包含 AsyncSocket 或 GCDAsyncSocket 类以使用它.您下载的库不是静态库或框架编译格式.如果您仔细阅读同一作者的示例,您就会看到它是如何完成的.

This library comes with a header file (either AsyncSocket.h or GCDAsyncSocket.h) and an implement file (either AsyncSocket.m or GCDAsyncSocket.m). All you need is to copy the .h and .m in your project. And using the #import statement to include the AsyncSocket or GCDAsyncSocket class in your class to use it. The library as you downloaded is not in a static library or framework compiled format. If you go thru the examples from the same author, you will see how it was done.

这篇关于从 CocoaAsyncSocket 开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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