realm - Model with the same property name throws error: has properties that are declared multiple times in its class hierarchy -
i have project displays 2 types of document, 1 local storage , dropbox, have 2 model, xxdocument , dbdocument. both model have properties such name, extension , last updated. assume it's common scenario, on start realm throws , error:
terminating app due uncaught exception 'rlmexception', reason: 'object 'dbdocument' has properties declared multiple times in class hierarchy: 'name', 'lastupdated', 'extension''
what's right way handle this? prefix each property model name?
edit
just clear few things. i've tried use super class hold common field , use 2 separated class without super class, both case not work.
case 1: xxdocument - name - extension - lastupdated
dbdocument - name - extension - lastupdated - rev - filepath
case 2:
case 1:
basedocument - name - extension - lastupdated
xxdocument -> basedocument // xxdocument class has no properties now
dbdocument -> basedocument - rev - filepath
if have declared properties in superclass of dbdocument
, shouldn't declaring them again in dbdocument
, since realm walks class hierarchy of classes collect set of properties model class.
Comments
Post a Comment