title: Multidimensional Array in Realm Swift (Maximum depth exceeded error)
body: <p>I want to make a 3D Array with Realm and I use List to accomplish this.
  This is the code for my RealmDatabase:</p>
  
  <pre><code>class Sensors : Object {
  
  
      dynamic var type = ""
      dynamic var name = ""
  
      let buttonAr = List&lt;buttons&gt;()
  
  }
  
  class buttons: Object{
     let  buttonsAdded = List&lt;objectNameTopic&gt;()
  }
  
  class objectNameTopic: Object {
      dynamic var name = ""
      dynamic var topic = ""
  }
  </code></pre>
  
  <p>And this is what I use to call it:</p>
  
  <pre><code>var saving = Sensors()
  var saving2 = objectNameTopic()
  var but = buttons()
  var array = ["on", "off"]
  var array2 = ["1","2"]
  var allSensors = useOfRealm.objects(Sensors.self)
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
  
      addSensor()
  
      for i in 0...array.count-1 {
          addSensor2(name: array[i], topic: array2[i])
  
      }
  
      if allSensors.count &gt; 0 {
          print(allSensors)
      }
  
  }
  
  
  func addSensor() {
  
      try! useOfRealm.write {
  
          saving.type = "topic1"
          saving.name = "mike"
          useOfRealm.add(saving)
  
  
      }
  
  }
  
  func addSensor2(name: String, topic: String) {
  
      try! useOfRealm.write {
  
          saving2.name =  name
          saving2.topic = topic
          useOfRealm.add(saving2)
  
          but.buttonsAdded.append(saving2)
          saving.buttonAr.append(but)
  
      }
  
  }
  </code></pre>
  
  <p>This is what I get when I print the results:</p>
  
  <pre><code>Results&lt;Sensors&gt; (
      [0] Sensors {
          type = topic1;
          name = mike;
          buttonAr = RLMArray &lt;0x6100000fd900&gt; (
              [0] buttons {
                  buttonsAdded = RLMArray &lt;0x6100000fdb00&gt; (
                      [0] &lt;Maximum depth exceeded&gt;,
                      [1] &lt;Maximum depth exceeded&gt;
                  );
              },
              [1] buttons {
                  buttonsAdded = RLMArray &lt;0x6180000fd180&gt; (
                      [0] &lt;Maximum depth exceeded&gt;,
                      [1] &lt;Maximum depth exceeded&gt;
                  );
              }
          );
      }
  )
  </code></pre>
  
  <p>Any Ideas of what I'm missing?</p>
  
  <p>Thanks in advance</p>