class Person: RLMObject { dynamic var name:String? dynamic var dogs:RLMArray(objectClassName: Dog.className()) } let person = Person() person.name = “Yoshida" let dog = Dog() dog.name = "John" let dog2 = Dog() dog2.name = "John2" person.dogs.addObjects([dog, dog2]) let realm = RLMRealm.defaultRealm() realm.beginWriteTransaction() realm.addObject(person) realm.commitWriteTransaction()