I have two pods in my project :
One, is YapDatabase
for key-value storage.
Two, is APAddressBook
to deal with phonebook.
I want to extract phonebook contacts as APContact
objects then store them in YapDatabase
.
The Problem is YapDatabase
wants the object to save to be serialised using its own way (Being a subclass).
I want to modify my APContact
to be a subclass of YapDatabaseObject
but they are in two different pods.
How, can i import OTRYapDatabaseObject.h
into APContact
without the error "OTRYapDatabaseObject.h" file not found
?
Thanks
The YapDatabase project does not enforce a base class. That is, there is no such thing as
YapDatabaseObject
, at least in the sense that it is not a part of the official API.The only requirements that YapDatabase itself enforces, is that the configured
serializer
&deserializer
are able to convert your object to & from data blobs.The wiki article "Storing Objects" has more information on this: https://github.com/yapstudios/YapDatabase/wiki/Storing-Objects
But the gist is that YapDatabase has a configurable
serializer
&deserializer
, and you can customize them to fit your needs.It looks like APContact is a pretty basic NSObject, consisting of only public properties. So to achieve your goal, all you really need is code (within your project) that can perform the serialization & deserialization of APContact objects. And then tweak YapDatabase's serializer & deserializer to use your custom APContact serialization & deserialization when appropriate.