title: How to handle optional/missing attributes of related Core Data objects in NDPredicate
body: <p>I've recently ran into an issue with core data that I'm unable to solve.</p>
  <p>I have the following object and relationships <code>Recommendation &lt;---&gt; Item</code></p>
  <pre><code>extension Recommendation {
    @nonobjc public class func fetchRequest() -&gt; NSFetchRequest&lt;Recommendation&gt; {
      return NSFetchRequest&lt;Recommendation&gt;(entityName: &quot;Recommendation&quot;)
    }
  
    @NSManaged public var age: Int?
    @NSManaged public var tags: Array&lt;String&gt;?
    @NSManaged public var object: Item?
  }
  
  extension Item {
    @nonobjc public class func fetchRequest() -&gt; NSFetchRequest&lt;Item&gt; {
      return NSFetchRequest&lt;Recommendation&gt;(entityName: &quot;Item&quot;)
    }
  
    @NSManaged public var id: String?
    @NSManaged public var name: String?
    @NSManaged public var recommendation: Recommendation?
  }
  </code></pre>
  <p>I want to fetch all <code>Item</code>s based on attributes in their related <code>Recommendation</code>.
  Some of these attributes could be missing.</p>
  <p>How would I create a NSPredicate to fetch objects where the <code>Recommendation.age</code> or <code>Recommendation.tags</code> could be non-existent (applicable to all ages/tags) or should be compared against a provided value?</p>
  <p>Should I always provide a Default Value?</p>