lundi 4 juillet 2016

Storing protobuf object locally in iOS


I am using gRPC for my iOS app's server communication. gRPC uses protobuf objects for these requests. I also have to store these objects locally in certain cases, and I was wondering if there was any ORM or ORM-like library or ideal way to store protobuf objects in iOS local storage. I know libraries like Realm require your data object to inherit from RealmObject, so in order for me to store my protobuf object in Realm, I would essentially have to map each value manually. Is there a way to directly store this Protobuf object in local storage for iOS? If not I think I'll simply use Realm and have a RealmObject for each protobuf and have a constructor like initWithProtoObj and essentially map the data and do vice-versa for RealmObject to Protobuf when I need to push something to the server.

Thanks in advance for any help!


Aucun commentaire:

Enregistrer un commentaire