1、本人使用swift4.1,弄了一晚上才弄好,结果还是一个小问题真是尴尬, 要在model中每个属性前面加上@objc
import UIKit
classUserModel: NSObject {
@objc var dix = String()
}
let dic = ["dix":"ffffff"] as NSDictionary
let model =UserModel.mj_object(withKeyValues: dic)!
print(model.dix)
import UIKit
classUserModel: NSObject {
@objc var dix = String()
}
let dic = ["dix":"ffffff"] as NSDictionary
let model =UserModel.mj_object(withKeyValues: dic)!
print(model.dix)