Great intro to Realm.
I have one question - is it possible to have Results<> represent more than one different Type of object?
Lets say I have 4 different types of objects - each not associated with one another - stored in Realm. Iβd like to have Results<> update my tableView with these different types of objects.
Would you need to create an artificial relationship class of some sort to βwrapβ all the different types of objects under one Results<> Type?
Hi pixelblur, Results
is typed and can contain only objects of the same type (as are collection types in general in Swift).
If you really want to mix different objects together you will need hold them in a different structure. For example you might try to create an Array<AnyObject>
and just add all of your objects of different types to that array - then have a switch
over the type of the current object in your tableView(_:, cellforRowAtIndexPath:)
method.
SIr where is entity relationship ? I didnt see