4 ms·
I was trying to add in a Realm test to a benchmarking project I already have set up to see how quickly I can retrieve a list of Stack Exchange sites from disk/d
by jc4p 12y ago
I was trying to add in a Realm test to a benchmarking project I already have set up to see how quickly I can retrieve a list of Stack Exchange sites from disk/db/etc, the Site model is laid out here: https://api.stackexchange.com/docs/types/site https://api.stackexchange.com/docs/types/site -- each Site object can have anywhere from 0 to N related_site objects, which in my current model I just have as a RelatedSite[], since my test case is running all the different ways to cache/read at the same time I was trying to make a method in my RealmObject version of Site that takes in a regular Site object and transforms everything over, but I couldn't figure out how to translate the RelatedSite[] array into a RealmList<RelatedSite> without actually iterating through every one and recreating them by hand.
- emanuelez 12y agoThank you for bringing the subject up! Importing data from JSON in a painless way is very high on the priority list. Right now we don't have an elegant solution for your specific use-case, but we're working on it so stay tuned! Please feel free to join us in the mailing list as we would love to hear more about your project and help with it if possible!