Hello and thanks for the support.
I'm quite new to ObjectMapper (and swift too, migrating from objective c)
I have an array of dictionaries I'm mapping using alamo and objectmapper to Realm.
I mapped all the keys, creating also a couple of custom mappers for custom date format to string and string to bool, and everything is ok
Now I have the last objects to map and I cannot find a clue (even aver googling some hours)
My json snippet is
"average_rating": "0.00",
"rating_count": 0,
"related_ids": [
1154,
641,
880,
551,
1062
],
I tried to create
var related_ids = List<Int64>()
but I didn't find any way to map the array to Realm list.
Any suggestion? I tried some of the transformers you find in gist related to objectmodel but the understaing is far from my current skill :(
Thanks!
Any luck to solve your problem. I am facing same problem. How to map the array?
coordinates = (
"76.2710833",
"10.8505159"
);
Any help?
The List
Any update on this? List of Ints is introduced but still not working with ObjectMapper
Solved this issue with:
https://github.com/APUtils/ObjectMapperAdditions
It works for List < Int >
func mapping(map: Map) {
related_ids <- (map["related_ids"], RealmTypeCastTransform())
}
Most helpful comment
The List is introduced in realm 3.0.x. Before that I had to create an IntObject as a realm Object and do some tricky mapping. Now upgrading to 3.0.x, the List is cleaner, but I have issue to do the mapping with ObjectMapper. Anyone can help?