Terminating app due to uncaught exception 'Invalid value', reason: 'Expected object of type string for property 'lat' on object of type 'BusStop', but received: 16.80292'
lawinko opened this issue · 1 comments
lawinko commented
This is My Realm Model
`class BusStop: Object{
@objc dynamic var id: Int = 0
@objc dynamic var name_en: String = ""
@objc dynamic var name_mm: String = ""
@objc dynamic var lat: String = ""
@objc dynamic var lng: String = ""
@objc dynamic var relations: String = ""
@objc dynamic var relation_count: Int = 0
var coordinate: CLLocationCoordinate2D {
let coordinate = CLLocationCoordinate2D(latitude: CLLocationDegrees(exactly: Double(lat)!)!, longitude: CLLocationDegrees(exactly: Double(lng)!)!)
return coordinate
}
// override static func primaryKey() -> String?{
// return "id"
// }
}`
mhergon commented
lat
& lng
must be Double