title: Get the Type of a Core Data relationship
body: <p>Is there an easy way to find the object type which forms a specific relationship in Core Data?</p>
  
  <p>For example, I have a one-to-many relationship:</p>
  
  <pre><code>Battery-----1-to-Many-----Comment
  </code></pre>
  
  <p>If I didn't know that the relationship was for a specific <code>Comment</code> object, is there a programatic way I could find out which object type it is, based solely on the set that I'm dealing with.</p>
  
  <p>Something along the lines of </p>
  
  <pre><code>battery.comments.classType = [Comment class]
  </code></pre>
  
  <p>I'm aware that both <code>Battery</code> and <code>Comment</code> are of type <code>NSManagedObject</code> - I'd like to know more specifically what they are.</p>
  
  <p>I'm also aware that if the <code>NSSet</code> contains any data, I can use any one of it's objects to query the type.  However I need to cater for when there is no data in the <code>NSSet</code>.
  Thank you.</p>