I used it to some extent on iOS, and with a metasynthetic extension , it works very well. I even managed to get code generation as a custom build step in Xcode. We switched to Thrift for our project (for other reasons), so I apologize if some of the details below are wrong, but overall how to do it.
- In Xcode 4.2, open the target properties, go to the "Build Rules" tab and create a new build rule for the "* .proto" files.
In "Use:" select "custom script" and use the script as follows:
protoc --plugin=/usr/local/bin/protoc-gen-objc $INPUT_FILE_PATH --objc_out=$DERIVED_FILES_DIR
In the output files, add the generated files (there must be two files, $(INPUT_FILE_BASE).pb.m and $(INPUT_FILE_BASE).pb.h .
- Add .proto files to your project.
source share