Kodeco Forums

Introduction to Protocol Buffers on iOS

Protocol buffers are a language-agnostic method for serializing structured data that can be used as an alternative to XML or JSON in your iOS apps.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/749-introduction-to-protocol-buffers-on-ios

Could be more interesting with a full stack Swift solution :wink:
Another solution is to use flatbuffer

@frohmen yes haha it’s suppose to spit out all of that. I couldn’t find a way to not make the script verbose. sorry :confused:

@tof yea could be cool!

I’m getting this error while running ./protoInstallation.sh :

libtool: link: cannot find the library Buffers/Starter/protobuf-3.1.0/src/libprotobuf.la or unhandled argument Buffers/Starter/protobuf-3.1.0/src/libprotobuf.la
The path looks wrong to me…

As a result I don’t have protoc in my system.

@akonakov do you by any chance have a space in the root directory? Like the following Starter and Starter 2 .
If the root directory has a space like Starter 2 it could be possible the script ./protoInstallation.sh will not be able to find the path.

As shown below:

Another alternative is to try to install protoc manually with the following:

  cd ./protobuf-3.1.0/
  ./configure
  make
  make check
  sudo make install
  sudo ldconfig # refresh shared library cache.

Tried to make the script as robust as possible :confused:

Yes, the root directory initially had a space in its name - now I’ve renamed it, but still getting the same error. And I can’t find ldconfig. No luck for me :frowning:

@akonakov

  1. can you try deleting every single project you downloaded.
  2. Clear your trash
  3. Can you redownload a fresh copy.

Make sure you don’t have duplicate names in the same directory. Spaces are bad with scripts :smiley:

I think it’s cached.

Yeah, it was cached somewhere. Eventually deleted everything unzipped before and extracted again. Now it looks to be OK, thanks, man!

1 Like

To mention: Apple has a format called Binary Plist. Not widely used thou.

After I’m done with the tutorial, how do I remove everything I just installed? I don’t have a lot of drive space so I’m looking to reclaim it.

@fbara, try looking into /usr/local/bin or /usr/local/bin to remove the protoc libs.

To uninstall flask you could try:

Hope this helps, thanks!

It does help, thanks for replying!

I am getting this error

Running ProtoBuf Compiler to convert .proto schema to Swift
dyld: Symbol not found: __TWPVSS13CharacterViews13IndexableBases
Referenced from: /usr/local/bin/protoc-gen-swift
Expected in: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCore.dylib
in /usr/local/bin/protoc-gen-swift
–swift_out: protoc-gen-swift: Plugin killed by signal 6.

How to make a post or put call with Protobuf object? I want to use alamofire for this call.

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]