iOS protocol buffer的使用
来源:互联网 发布:淘宝网装饰腰带 编辑:程序博客网 时间:2024/05/16 09:38
protocol buffer 是 google 的一种数据交换的格式,它独立于语言,独立于平台。google 提供了三种语言的实现:java、c++ 和 python,每一种实现都包含了相应语言的编译器以及库文件。由于它是一种二进制的格式,比使用 xml 进行数据交换快许多。
google并没有提供Objective-C的实现,但是借助开源的力量,我们还是找到了解决方案。
首先到这个链接处:http://code.google.com/p/metasyntactic/downloads/list 下载Objective-C代码的生成包,创建protoc编译器:
./autogen.sh
./configure
make
接下来将.proto文件编译成相应的objc文件,假设当前目录为protocol buffer 目录,在当前目录下的test目录下有Place.proto文件,则可运行以下命令:
cd src
./protoc --proto_path=../test/ --objc_out=../test/ ../test/Place.proto
那么将会在test目录下生成Place.pb.h 和Place.pb.m这两个相对于的objective-c文件。最后在xcode中引入protocol buffer库。将ProtocolBuffer/objectivec/ProtocolBuffers.xcodeproj工程文件拉到自己工程文件的Framework目录下,并在工程的TARGETS下的Build Settings选项卡下的User Header Search Paths 加入../ProtocolBuffer/objectivec/Classes/,这样就将ProtocolBuffers静态库链接到了xcode工程下了。
- iOS protocol buffer的使用
- iOS开发-protocol buffer的使用
- protocol buffer的使用
- 在iOS中Protocol Buffer(Protobuf3.3.0)的使用
- google protocol buffer的使用
- Protocol Buffer的使用(python)
- 浅谈protocol buffer的使用
- protocol buffer的简单使用
- 在iOS中使用Google Protocol Buffer
- 在iOS下使用google protocol buffer
- 在IOS下使用protocol buffer
- ios 编译并使用Protocol Buffer
- 在iOS下使用google protocol buffer
- 在iOS下使用google protocol buffer
- Protocol Buffer与iOS的交互
- Protocol Buffer与iOS的交互
- ios Protocol buffer安装
- Google Protocol Buffer 的使用和原理
- gh0st支持win7和win8
- VC++通过API连接MySQL
- 几种任务调度的 Java 实现方法与比较
- 在OS X中安装配置JDK
- LeetCode-Combination Sum III-解题报告
- iOS protocol buffer的使用
- 【Leetcode】Isomorphic Strings
- MySQL的数据类型
- Sublime3使用记录 (Windows)
- startService与bindService的区别
- Watcher 实现机制之客户端注册
- android 中 c/cpp创建应用剖析(一)
- 第四章作业:4.17:建立一个对象数组,内放6个学生的数据(学号,成绩),用指针向数组首元素,输出第2,4,6个学生的数据。
- Android开发中的多线程