简体   繁体   中英

How can I save [Double] array into Realm?

I need to save array of Double's into the Realm. But It seems to be unsupported.

dynamic var doubleArray = [Double]()  // error
let doubleArray2 = List<Double>()     // error

NSMutableArray seems to be unsupported too. I tried find solution in documentation and API but unsuccessfully. Thanks

Only lists of Realm Objects can be used inside a parent Realm Object.

The easiest way to get around this would be to create another Realm Object subclass that has a Double property, and then use multiple instances of those to be saved in the parent List property.

Hope that helped!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM