You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import Foundation
import RealmSwift
import HandyJSON
class HomeHandyJson: Object, HandyJSON {
// @persisted
@Persisted var is_expire: String?
@Persisted var use_result_imgs: MyResullt?
required override init(){
super.init()
}
}
class MyResullt: Object, HandyJSON { @persisted var imgs: List
required override init(){
super.init()
}
}
class ImgsSSxxx: Object, HandyJSON { @persisted var attachment_id: String? @persisted var fileName: String? @persisted var seal_id: String? @persisted var confirm_status: Int? @persisted var path: String? @persisted var path_thumbnail: String? @persisted var fileLength: Int? @persisted var oss_url: String? @persisted var fileSize: String?
required override init(){
super.init()
}
}
let realm = try! Realm()
try! realm.write {
//can not add to realm and bb is nil 。when i remove @Persisted and Object it can be a HomeHandyJson
let bb = HomeHandyJson.deserialize(from: responseDic["data"] as! [String : Any])
realm.add(bb!)
}
The text was updated successfully, but these errors were encountered:
import Foundation
import RealmSwift
import HandyJSON
class HomeHandyJson: Object, HandyJSON {
// @persisted
}
class MyResullt: Object, HandyJSON {
@persisted var imgs: List
required override init(){
super.init()
}
}
class ImgsSSxxx: Object, HandyJSON {
@persisted var attachment_id: String?
@persisted var fileName: String?
@persisted var seal_id: String?
@persisted var confirm_status: Int?
@persisted var path: String?
@persisted var path_thumbnail: String?
@persisted var fileLength: Int?
@persisted var oss_url: String?
@persisted var fileSize: String?
required override init(){
super.init()
}
}
The text was updated successfully, but these errors were encountered: