2017-02-14 116 views
0

我正在将iOS应用程序迁移到Realm。我有几个定义过多的关系,如什么是“不能拥有原产地名称”在Realm中的意思iOS

@property (nullable) RLMArray<Book> *books; 

但是我收到这些错误。

Terminating app due to uncaught exception 'RLMException', reason: 'Schema validation failed due to the following errors: 
- Property 'User.books' of type 'array' cannot have an origin property name. 

本书也是一个带有userId字段的模型。这个错误是什么意思?我找不到任何参考。

+0

你能分享你的类的完整接口声明,以及Realm的特殊方法('+ primaryKey','+ requiredProperties','+ linkingObjectsProperties')的任何实现吗? – bdash

回答

3

我相信这个错误表明您已经实现了你的类+linkingObjectsProperties并返回被books属性RLMPropertyDescriptor,尽管它不是一个RLMLinkingObjects财产。

+0

这是绝对的。他们最初是RLMLinkingObjects,但模型改变了。我忘了删除linkingObjectsProperties条目。 – smokingoyster

相关问题