protocol_buffers简易操作
生活随笔
收集整理的這篇文章主要介紹了
protocol_buffers简易操作
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
最近使用CocoaPods來添加第三方類庫,無論是執行pod install還是pod update都卡在了Analyzing dependencies不動原因在于當執行以上兩個命令的時候會升級CocoaPods的spec倉庫,加一個參數可以省略這一步,然后速度就會提升不少。加參數的命令如下:
pod install --verbose --no-repo-update
pod update --verbose --no-repo-update
版本 for ios && swift
-> ProtocolBuffers (1.9.8)
? ?Protocol Buffers for Objective-C
? ?pod 'ProtocolBuffers', '~> 1.9.8'
? ?- Homepage: http://protobuf.io#objc
? ?- Source: ? https://github.com/alexeyxo/protobuf-objc.git
? ?- Versions: 1.9.8, 1.9.7, 1.9.6, 1.9.5, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9,
? ?1.2.2, 1.2.1, 1.2 [master repo]
-> ProtocolBuffers-Swift (2.0)
? ?Protocol Buffers for Swift
? ?pod 'ProtocolBuffers-Swift', '~> 2.0'
? ?- Homepage: http://protobuf.io#swift
? ?- Source: ? https://github.com/alexeyxo/protobuf-swift.git
? ?- Versions: 2.0, 1.6.2, 1.6.1, 1.6, 1.5.2, 1.5.1, 1.5, 1.4 [master repo]
jamie:~ jamie$
Protocol Buffers for Objective-C
? ? ?
An implementation of Protocol Buffers in Objective C.
Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. This project is based on an implementation of Protocol Buffers from Google. See the Google protobuf project for more information.
This fork contains only ARC version of library.
How To Install Protobuf
Building the Objective-C Protobuf compiler
1. Check if you have Homebrew brew -v
2. If you don't already have Homebrew, then install it ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3. Install the main Protobuf compiler and required tools brew install automake brew install libtool brew install protobuf
4. (optional) Create a symlink to your Protobuf compiler. ln -s /usr/local/Cellar/protobuf/2.6.1/bin/protoc /usr/local/bin
5. Clone this repository. git clone https://github.com/alexeyxo/protobuf-objc.git
6. Build it! ./scripts/build.sh
Adding to your project as a sub project
...
1. Add /src/runtime/ProtocolBuffers.xcodeproj in your project.
Adding to your project as a CocoaPod
...
1. cd <your .xcodeproj directory>
2. echo -e "platform :ios , 6.0 \nlink_with '<YourAppTarget>', '<YourAppTarget_Test>' \npod 'ProtocolBuffers'" > Podfile
3. pod install
Compile ".proto" files.
protoc --plugin=/usr/local/bin/protoc-gen-objc person.proto --objc_out="./"
轉載于:https://my.oschina.net/u/1244672/blog/616553
總結
以上是生活随笔為你收集整理的protocol_buffers简易操作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: iOS 随笔 允许所有不安全网络访问项目
- 下一篇: 快速高效计算sin与cos