Encode/Decode ObjC Protobuf object for persistence
Since Objective C library does not support serializing/deserializing JSON format protobuf objects, does it require writing custom initWithCoder and encodeWithCoder methods in order to persist protobuf objects on disk? Or if there is a way to store/restore binary format on disk?
Why do they need to be written in a text format, why not just write them as the native protobuf binary form? The whole point of protos is a binary format that can be evolved with time (see the docs on what you can/can't do to maintain compatibility). Unknown fields get preserved in the binary format, but for JSON, unknown fields aren't supported and can break parsing.
As far as NSCoding support, the base message has that incase you want to write a message inside another NSObject. But if you are writing protos directly to disk, there is no need to add that wrapping unless you really want it.
Ah, good to know that the base message has NSCoding, that helps, thanks!