Friday, February 23, 2024
HomeiOS Developmentios - Error in Declaring Non-Non-obligatory Map Property in Realm Swift Object

ios – Error in Declaring Non-Non-obligatory Map Property in Realm Swift Object


I’ve this realm object with a map property:

class UserModel: Object {
       @Continued var uploadMap = Map<String, UploadingModel>()
}

the place UploadingModel is one other realm object.

as soon as I ran the app I acquired this error:

*** Terminating app on account of uncaught exception 'RLMException',
motive: 'Map<String, UploadingModel> property 
'uploadMap' have to be marked as non-obligatory.'

Within the official documentation: realm-swift there’s an instance that initialize the map just like the above with out marking it as non-obligatory.
Additionally, I take advantage of different realm varieties like Checklist<UploadingModel>() and no error is thrown.

How can I keep away from mark it as non-obligatory and why the error is thrown?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments