Tarvo Mäesepp
Tarvo Mäesepp

Reputation: 4533

Swif'ts Array to Realm's Result

I am trying to convert Swift [Object]() array to Realm's Results<Object>!. I know that vice-versa is possible (you can see here) but is it possible to do what I want?

So I want something like result as! [Object].

Upvotes: 0

Views: 192

Answers (1)

dr_barto
dr_barto

Reputation: 6065

Result objects are proxies for data stored in the db. You can only get them via queries, but cannot instantiate them yourself (see the docs).

To still get Result objects, you'd have to run a new query for the objects you already have, and use the returned Result... I would not suggest that though.

Upvotes: 1

Related Questions