Protobuf missing 'list' suffix in Objective-C generated code

106 views Asked by At

I'm using protobuf 2.6.1 with this plugin which I compiled myself.

In the project I'm working with Protobuf models are already present. I tried to regenerate the files using the following command:

protoc --plugin=/path/to/the/compiled/plugin/objc-gen --objc_out=./gen/ NAME.proto OF.proto THE.proto FILES.proto

Generally, the files match closely with the previously generated models, however, there are some syntactic differences.

The following .proto string:

repeated MyType case = 4;

is translated to this line in Obj-C (New plugin, with ARC):

@property (readonly, strong) NSArray * case;

And it used to be with the List suffix (Old plugin, non-ARC, doesn't work with the current version of macOS):

- (NSArray*) caseList;

Given that case is a keyword in Objective-C, this triggers compilation errors.

Questions:

  1. Since what version Protobuf changed syntax to omit List suffix?

  2. Is it possible to trigger "old" behavior with a new plugin?

  3. What is the last version of plugin that runs on macOS 10.14.3 and able to generate the files with old style (i.e. with the list suffix)?

0

There are 0 answers