美文网首页
ios protobuf 3.0协议处理

ios protobuf 3.0协议处理

作者: iOS_成才录 | 来源:发表于2016-10-17 20:32 被阅读684次
  • 一、安装终端protobuf编译生成.h,.m工具
  • 二、项目中使用第三方框架 ProtocolBuffers
  • 三、protoc 生成.h、.m文件
  • 编写ResponseResult.proto文件
syntax = "proto3";
message ResponseResult {
     int32 code = 1;
     string error = 2;
     string error_description = 3;
}
  • 利用命令生成:进入ResponseResult.proto目录下,在终端输入
    protoc ResponseResult.proto --lobjc_out="./"
  • 四、使用生成的.h、.m文件
  • 将生成的.h、.m放入项目中就可以使用了,ios可以使用ProtocolBuffers三方框架处理

相关文章

网友评论

      本文标题:ios protobuf 3.0协议处理

      本文链接:https://www.haomeiwen.com/subject/aaflyttx.html