ios - Use of unimplemented initializer 'init(realm:schema:)' when calling Realm().objects -
i'm trying retrieve realm's objects using
realm(path: realm.defaultpath).objects(fruits)
this in result:
12: 7: fatal error: use of unimplemented initializer 'init(realm:schema:)' class db.fruits
the object has following init:
required init() { super.init() nextprimarykey() }
i've gone through information init()s issues, none of them solved problem (including almost-exact question). idea how solve it?
overriding init is supported. however, may run issue when using convenience init
designated initializer if override required init
. can fixed removing required init
.
for example:
required init() { super.init() } convenience init(dict: [string: anyobject]) { self.init() // custom init work }
should become:
convenience init(dict: [string: anyobject]) { self.init() // still calling self.init(), not super.init() // custom init work }
Comments
Post a Comment