The examples on this page use the data model of a project
management app that has two Realm object types:
Project has zero or more
See the schema for these two classes,
Use realm.createObject() in a transaction to create a persistent instance of a Realm object in a realm. You can then modify the returned object with other field values using accessors and mutators.
The following example demonstrates how to create an object with createObject():
You can also insert objects into a realm from JSON. Realm
supports creating objects from
Realm ignores any properties present in the JSON that are
not defined in the Realm object schema.