protocol_buffers简易操作

最近使用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="./"




你可能感兴趣的:(protocol_buffers简易操作)