-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having multiple object types in RLMResults #3112
Comments
would your objects logically have a common base class? How would you even do a query? In Core Data you could have a common 'parent' object and do a single query that might return different objects. But in general it can be a bit confusing. I've done two things in the past to to your solution... But if you want a "mix" model (like say... a Facebook feed?)... then you may want to consider a action or proxy object that has a relationship to the "real" object.
And you could just add properties to the "FeedItem" that will let you sort it the way you want (in my example, I assume by date), but have all the "real" data using the "itemObject" relationship. I've never tried using an 'Object' pointer for a relationship... but it could work? Would that work? |
Have you read the Model Inheritance section of our docs along with the in-depth code samples it links to? That should explain everything you need to know about why a single If anything isn't clear in that documentation, please let us know and we'll be sure to review it. |
@mishagray @jpsim thanks for your responses. I went with the proxy model ( |
Is it possible to have objects of multiple types in a single
RLMResults
?I'm using
RLMResults
as datasource for my UITableView, and it would be nice if the different datatypes the tableview represents, are all in a singleRLMResults
The text was updated successfully, but these errors were encountered: