How to load json object in to Relam model


(venkatesh) #1

i want to load my JSONObject into relam model but its mismatching

for (i in 0 until medication.length()) {
var jsonObject: JSONObject = medication.getJSONObject(i)
var medicationDataBase = MedicationDataBase()
medicationDataBase.frequencyDetail = jsonObject.getJSONObject(“frequencyDetail”)
// i want to save frequency details object into realm but its showing mismatch types
}