ios - Declare an array of Int in Realm Swift -


how can declare array of integers inside rlmobject?

like :

dynamic var key:[int]? 

gives following error :

terminating app due uncaught exception 'rlmexception', reason: ''nsarray' not supported rlmobject property. properties must primitives, nsstring, nsdate, nsdata, rlmarray, or subclasses of rlmobject. see https://realm.io/docs/objc/latest/api/classes/rlmobject.html more information.' 

lists of primitives not supported yet unfortunately. there issue #1120 track adding support that. you'll find there ideas how can workaround currently.

the easiest workaround create object hold int values. model have list of object.

class foo: object {     let integerlist = list<intobject>() // workaround }  class intobject: object {     dynamic var value = 0 } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -