title: Searching for objects in nested NSSets
body: <p>I am trying to get some objects from a complex structure of nested <code>NSSet</code>s, depicted below:</p>
  
  <p><img src="https://i.stack.imgur.com/ClqJj.png" alt="enter image description here"></p>
  
  <p><code>obj1</code>, etc. is of type <code>MyObject</code>.</p>
  
  <p>I used a predicate but it did not return anything:</p>
  
  <pre><code>NSPredicate *predicate=[NSPredicate predicateWithFormat:@"self isKindOfClass:%@",[MYObject class]];
  </code></pre>
  
  <p>I think <code>NSPredicate</code> looks for the first layer of objects in NSSet.[Highlighted above].</p>
  
  <p>To overcome this issue I traverse through all the sets and get the <code>MyObject</code> instances. Is there any better approach than this? It's too time consuming to get values for <code>obj1</code>,<code>obj2</code>,<code>obj3</code>,<code>obj4</code>.</p>