EXC_BAD_INSTRUCTION
Closed this issue · 0 comments
yamila-fraiman commented
I am getting data from my server. The response is:
{"languages":[{"language":"en","disabled":false}]}
When I do the request the code suddenly throws EXC_BAD_INSTRUCTION and it gets stuck in the error. If I remove inheritance Object from Language.swift it works ok
LanguageResponse.swift
import ObjectMapper
class LanguageResponse: Mappable {
var languages: [Language]?
required init?(_ map: Map){
}
override func mapping(map: Map) {
super.mapping(map)
languages <- map["languages"]
}
}
Language.swift
import UIKit
import RealmSwift
import ObjectMapper
class Language: Object, Mappable {
dynamic var language: String = ""
override static func primaryKey() -> String? {
return "language"
}
required convenience init?(_ map: Map) {
self.init()
}
func mapping(map: Map) {
language <- map["language"]
}
}