Skip to content
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

Cannot use RLMArray with custom protocols #1773

Closed
francoismarceau29 opened this issue Apr 21, 2015 · 2 comments
Closed

Cannot use RLMArray with custom protocols #1773

francoismarceau29 opened this issue Apr 21, 2015 · 2 comments

Comments

@francoismarceau29
Copy link

Hi! I am trying to use a RLMArray which contains RLMObjects shielded by a protocol and I get the error:

'APPOption' is not supported as an RLMArray object type. RLMArrays can only contain instances of RLMObject subclasses

I have a "ShopifyOption" and a "MagentoOption" which are both shielded by the APPOption protocol :

@interface ShopifyOption : RLMObject <APPOption>
@end

@interface MagentoOption : RLMObject <APPOption>
@end

I have an object which hold an array of options:

@property RLMArray<APPOption>

Realm uses reflection to get the class name from the property above so it clearly can't work. Is there a way around this?

Thanks

@jpsim
Copy link
Contributor

jpsim commented Apr 21, 2015

Hi @francoismarceau29, RLMArray's can only link to objects of a single type. We have an issue open discussing the possibility of adding support for abstract classes or polymorphic link support in #1109.

@jpsim jpsim closed this as completed Apr 21, 2015
@francoismarceau29
Copy link
Author

Thanks, hope it makes it in soon!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants