Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not work with RealmSwift.xcframework #475

Open
locooo opened this issue Nov 24, 2022 · 1 comment
Open

Not work with RealmSwift.xcframework #475

locooo opened this issue Nov 24, 2022 · 1 comment

Comments

@locooo
Copy link

locooo commented Nov 24, 2022

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!)
                }
@stevendinggang
Copy link

stevendinggang commented Nov 24, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants