Swift: Store arrays of custom classes in Core Data
<p>I'm new to Core Data but for a new project of mine, I would like to save my data to Core Data.
I want to create a Reptile-class which contains a couple of  custom class arrays. Without Core Data I would have something like this:</p>

<pre><code>import Foundation
import UIKit

class Reptile_ {

    private var _name: String?
    private var _dateOfBirth: String?
    private var _morph: String?
    private var _breed: String?
    private var _feedingPeriodInDays: Int?
    private var _reminderTime: NSDate?
    private var _idealTemperatureAtDay: String?
    private var _idealTemperatureAtNight: String?
    private var _gender: Gender?
    private var _image: UIImage?
    private var _imageHeader: UIImage?

    private var _sheddings: [Shedding_]?
    private var _feedings: [Feeding_]?
    private var _defecations: [Defecation_]?
    private var _weights: [Weight_]?
    private var _lengths: [Length_]?
    private var _others: [Others_]?

}
</code></pre>

<p>And e.g. the class <code>Weight_</code> would look something like this:</p>

<pre><code>import Foundation

class Weight_ {

    private var _date: NSDate?
    private var _weight: Double?

}
</code></pre>

<p>I can use Core Data to save a single class with some attributes as Strings, Boolean Data, ... But I do not know how I would save the arrays of custom objects?</p>

<p>I've read somewhere that I need to create Relationships (one to many) with the base <code>Reptile</code> class. So I've done that which resulted in this:</p>

<p><a href="https://i.stack.imgur.com/eOfOF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/eOfOF.png" alt="enter image description here"></a></p>

<p>Is this the correct way for adding an array of custom objects? If so, How do I continue (simply click '<em>CreateNSManagedObject Subclass...</em>'?)? How do I add a instance to the array? How do I read it?</p>