Realm: How to Add Two Results <(Object)> in Realm
RLMResults
are like an array, but not an array, so you cannot add them directly, you need to use predicates to get your results. This is mentioned in the Realm Doc
RLMResults is a type of automatic container update in Realm returned from object requests.
RLMResults can be queried with the same predicates as RLMObject and RLMArray, and you can chain queries to further filter query results.
RLMResults cannot be created directly.
But if you want to add objects RLMArray
or RLMResults
to an existing one RLMArray
, you can use the – addObjects:
method RLMArray
only the condition is that both results must be of the same class. RLMArray Doc for reference.
source share