I am new to Realm and having this issue.
I am having a Dictionary
like this
{
firstName : "Mohshin"
lastName : "Shah"
nickNames : ["John","2","3","4"]
}
and a class
like this
class User: Object {
var firstName: String?
var lastName: String?
var nickNames: [String]?
}
While I am trying to insert values it is throwing an exception as below
Property 'nickNames' is declared as 'NSArray', which is not a supported RLMObject property type. All properties must be primitives, NSString
, NSDate
, NSData
, NSNumber
, RLMArray
, RLMLinkingObjects
, or subclasses of RLMObject
.
See https://realm.io/docs/objc/latest/api/Classes/RLMObject.html for more information.
I have also tried
var nickNames = NSArray()
var nickNames = NSMutableArray()
But not working.Do I need to make the Nickname model class and create a property as follow or there's a way to do this ?
var nickNames = List<Nickname>()