Search code examples
iosrealm

What does "cannot have an origin property name" mean in Realm iOS


I'm migrating my iOS app to Realm. I have a few too many relationships defined such as,

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

But I'm getting these errors.

 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.

Book is also a model with a userId field. what does this error mean? I can't find any references to it.


Solution

  • I believe this error indicates that you've implemented +linkingObjectsProperties on your class and are returning a RLMPropertyDescriptor for the books property, despite it not being an RLMLinkingObjects property.