I am new to Realm and have this problem.
I have Dictionarylike this
{
firstName : "Mohshin"
lastName : "Shah"
nickNames : ["John","2","3","4"]
}
and a classlike this
class User: Object {
var firstName: String?
var lastName: String?
var nickNames: [String]?
}
While I try to insert the values, it throws an exception as shown below
The nickNames property is declared as an NSArray, which is not a supported type of the RLMObject property. All properties must be primitives, NSString, NSDate, NSData, NSNumber, RLMArray, RLMLinkingObjectsor subclasses RLMObject.
See https://realm.io/docs/objc/latest/api/Classes/RLMObject.html for details .
I also tried
var nickNames = NSArray()
var nickNames = NSMutableArray()
But does not work. Do I need to create a Nickname model class and create a property as follows, or is there a way to do this?
var nickNames = List<Nickname>()