(Translated from English.) I am trying to get the title and description from a JSON resource from the REALM database. I can get the title without any problems, but I can't get the description, because this is a reserved name in SWIFT, so I tried ObjectMapper. And still, I can not get a description ... Code such ...
I also have another problem. How can I write a source object from NewRealmSourceLib to a NewRealmLib object. My way does not work!
{ "author": "http://www.abc.net.au/news/mazoe-ford/6525834, http://www.abc.net.au/news/dom--vukovic/7637226", "title": "Jury takes just 32 minutes to convict two men over Daley's violent death", "description": "Two men are found guilty over the death of Lynette Daley, whose naked body was found bruised and bloodied after a boozy 2011 camping trip to a remote beach in northern NSW.", "url": "http://www.abc.net.au/news/2017-09-06/lynette-daley-trial-delivers-guilty-verdicts/8878848", "urlToImage": "http://www.abc.net.au/news/image/7392268-1x1-700x700.jpg", "publishedAt": "2017-09-06T09:14:02Z" }, class NewRealmLib : Object, Mappable { dynamic var title: String = "" dynamic var descript: String = "" var source: NewRealmSourceLib? required convenience init?(map: Map) { self.init() } func mapping(map: Map) { descript <- map["description"] title <- map["title"] } override static func primaryKey() -> String? { return "title" } } class NewRealmSourceLib: Object { dynamic var source: String = "" override static func primaryKey() -> String? { return "source" } }