title: Filtering Realm objects with Swift
body: <p>I always get the following error when trying to filter my Realm database using <code>NSPredicate</code>:</p>
  
  <blockquote>
    <p>Property 'text' is not a link in object of type 'getType'</p>
  </blockquote>
  
  <p>I want to filter my Realm database to show only the items that have some specific text in them. This is what I've tried:</p>
  
  <pre><code>let realm = try! Realm()
  let predicate = NSPredicate(format: "typez.text.filter = 'special'")
  let filterThis = realm.objects(Publication).filter(predicate)
  print(filterThis)
  </code></pre>
  
  <p>The relevant portion of my model classes is:</p>
  
  <pre><code>class Publication: Object, Mappable {
      dynamic var id: Int = 0
      var typez = List&lt;getType&gt;()
      dynamic var url: String?
  }
  
  class getType: Object, Mappable {
      dynamic var text: String = ""
  }
  </code></pre>