Reputation: 350
I need help to configure/use protobuf in Objective-C for a iOS app. I've tried all but I keep getting errors on xcode. Did anyone manage to make protobuf work well in Objective-C/iOS?
Upvotes: 4
Views: 6061
Reputation: 32597
I have used it to some extent on iOS, and with metasyntactic's extension, it works really well. I even managed to get the code generation as a custom build step in Xcode. We switched to Thrift for our project (for other reasons), so my apologies if some details below are wrong, but in general this is how to do it.
In "Using:", choose "custom script" and use a script like this:
protoc --plugin=/usr/local/bin/protoc-gen-objc $INPUT_FILE_PATH --objc_out=$DERIVED_FILES_DIR
In Output files, add the generated files (there should be two files, $(INPUT_FILE_BASE).pb.m
and $(INPUT_FILE_BASE).pb.h
.
Upvotes: 3