protocol_buffers简易操作

本文介绍了一种在使用CocoaPods时提高安装及更新效率的方法,即通过添加特定参数来避免不必要的spec仓库更新。此外,还提供了Protocol Buffers在Objective-C与Swift中的版本依赖信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近使用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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值