thrift 通信的使用 /安装

参考:

http://blog.csdn.net/yohunl/article/details/41748511

http://blog.csdn.net/amuseme_lu/article/details/6261719

https://wiki.apache.org/thrift/ThriftUsageObjectiveC

https://brew.sh/

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

安装 brew(brew 用来安装软件用)
命令:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

电脑被隐藏的路径
➜ /Users/xiaokui >brew link makedepend
Linking /usr/local/Cellar/makedepend/1.0.5... 0 symlinks created

1.thrift的安装

先 sudo brew update
再 sudo brew install thrift

使用的话 可以先用 thrift -help来查看命令

2.最基本的使用 http://blog.csdn.net/blue_jjw/article/details/9147165
建立一个thrift文件

然后使用命令(要在 .thrift 文件所在的目录中)
thrift --gen cocoa idl.thrift
就可以在当前目录下生成.h .m OC文件

3.在项目中使用,首先项目中肯定要添加thrift框架啊 (就是从官方的gitHub https://github.com/apache/thrift 下载源码,然后找到 lib/cocoa,将其拷贝到你工程里,就可以了 )

将 lib/cocoa 文件夹拷贝的项目中

原文地址:https://www.cnblogs.com/daxueshan/p/6773391.html