title: Swift and Realm: getting Thread 1: signal SIGABRT when add objects in list
body: <p>I define three classes:</p>
  
  <p>CoffeeBrand:</p>
  
  <pre><code>dynamic var brandName = ""
  let brands = List&lt;Coffee&gt;()
  </code></pre>
  
  <p>Coffee:</p>
  
  <pre><code>dynamic var name = ""
  let cupAmount = List&lt;CoffeeCup&gt;()
  </code></pre>
  
  <p>CoffeeCup: </p>
  
  <pre><code>dynamic var cup = 0
  dynamic var caffeine = 0
  </code></pre>
  
  <p>And wanna try it so I add a brand Starbucks to try how it will be like in the table viewed</p>
  
  <pre><code>class CoffeeListsTableViewController: UITableViewController {
  
      // MARK: Properties
      var brands: Results&lt;CoffeeBrand&gt;!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          let Starbucks = CoffeeBrand(value: ["Starbucks",["Iced Latte", [200,150],[500,150]]])
  
          try! realm.write() {
              realm.add(Starbucks)
          }
      }
  }
  </code></pre>
  
  <p>But what I got is "Thread 1: signal SIGABRT", and I checked that I think this should working without thread 1(which I google and try to find what's wrong from others' questiones)</p>
  
  <p>With in the table data source of this:</p>
  
  <pre><code>override func numberOfSections(in tableView: UITableView) -&gt; Int {
      // #warning Incomplete implementation, return the number of sections
      return 1
  }
  
  override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return brands.count
  }
  
  override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell{
      //let cellIdentifier = "CoffeeBrandTableViewCell"
      let cell = tableView.dequeueReusableCell(withIdentifier: "CoffeeBrandTableViewCell", for: indexPath) as! CoffeeBrandTableViewCell
      // in my cell, only a label of brandName
      let brandList = brands[indexPath.row]   
      cell.brandName.text = brandList.brandName
      return cell
  }
  </code></pre>