background preloader

Protobuf

Facebook Twitter

Booyah/protobuf-objc. C++ - Google protocol buffers on iOS. Use protobuf on iphone app. This post is a step by step tutorial showing how to use protobuf in iphone application.

use protobuf on iphone app

It shows how to:Create a reusable static libraryCreate a executable projectMix C++ code with object C code1. Start terminal, cd to root folder of protobuf and run . /configure here to generate config.h header file and makefile. 2. Start XCode and create a new project. Scala - How Can I Return Protocol Buffers Directly in Play! 2.0 Framework. Jcayzac/play-protobuf. Sbt/sbt-protobuf. Objective c - How can I disable ARC for a single file in a project. Regwez/protobuf-objc-iOS5. ProtocolBuffers - metasyntactic - Objective-C Protocol Buffers for OSX and the iPhone - Cyrus' Playground.

Protocol Buffers are a way of encoding structured data in an efficient yet extensible format.

ProtocolBuffers - metasyntactic - Objective-C Protocol Buffers for OSX and the iPhone - Cyrus' Playground

For more information see the main page here. This project contains a port of Protocol Buffers that can be used in OSX 10.5 and later and on the iPhone OS 2.0 and later. The port includes a Protocol Buffer compiler (protoc) and a Protocol Buffer static library that you link into any project that you want protobuf support for. The protoc compiler supports almost all the features of the protobuf 2 language and when given .proto files as input will generate the specialized Objective-C classes necessary to both read and write instances of the messages contained therein.

These classes, along with the supplied static library, will then allow your code to read and write protobuf instances simply and in a typesafe manner. You write a .proto file like this: message Person { required int32 id = 1; required string name = 2; optional string email = 3;} Or like this to read a message back from raw protobuf data: Compile protobuf 2.4.1 on iOS 5. Export ARCH=arm-apple-darwin10 export ARCH_PREFIX=${ARCH}- export PLATFORM=iPhoneOS export SDKVER=5.0 export DEVROOT=/Developer/Platforms/${PLATFORM}.platform/Developer export SDKROOT="$DEVROOT/SDKs/${PLATFORM}$SDKVER.sdk" export PKG_CONFIG_PATH="$SDKROOT/usr/lib/pkgconfig:$DEVROOT/usr/lib/pkgconfig"

Compile protobuf 2.4.1 on iOS 5

Protocol Buffers for IOS. > Is there any direct support for Protocol Buffers in iOS?

Protocol Buffers for IOS

(armv6, > armv7) > > I have gone through he following link.. > > It uses v2.2 and currently available version is v2.4 I use latest version in my app .. you don't really need objc direct support if you are familiar with C++, there is only one point where you have to pass from std::string to NSData and viceversa. And its pretty simple. To compile and test the easiest way Ive found is to just import the whole google directory in my own project :) (the second time you can make your own framework but for testing this procedure just works) - download latest version - autogen configure and make like you were just building for macosx (you need command line tools) . To give you an idea this is what I directly compile.

Compile Protobuf for iOS » Niklas Saers' blog. For a project I’m doing at work, that I hope will eventually be open source, I needed to have protobuf compiled for iOS.

Compile Protobuf for iOS » Niklas Saers' blog

A colleague of mine showed me how it had been compiled on iOS 4, using these scripts, but with iOS 5 I ended up with binaries compiled for the arm architecture instead of the armv7 architecture. Be aware that the iOS 5 SDK actually ships with a version of protobuf, but it’s a bit old, being version 2003001. And it only ships the binary, not the headers. To compile protobuf, grab the latest source (which is 2.4.1 at the time of writing this) and run the following script (download script): After running this, you should have a directory called /tmp/protobuf/arm that is compiled for your iPhone or iPad with the armv7 architecture.

Protobuf ios. Jcayzac/play-protobuf.