title: Fetched properties as properties of an NSManagedObject subclass
body: <p>I have a subclass of NSManagedObject (NSMO) called Team. Team has a one to many relationship with another NSMO subclass called Contract. Contract has a 1-to-1 with Player (another NSMO). I would like to simplify my code that uses Team and be able to just refer to its "players". Players will just be an array of players that have a contract with a given team.</p>
  
  <p>I've tried creating a fetched property called players in XCode's data modeling tool with little success. I've tried many different approaches, but the one that makes the most sense is to name it "players", have the destination as Player and finally have as my predicate "contract.team.name == SELF".</p>
  
  <p>In my Team class I have a property of NSArray called players (with is @dynamic players in the implementation). When I NSLog(@"%@", self.players) it logs out...</p>
  
  <pre><code>Relationship fault for (&lt;NSFetchedPropertyDescription: 0x6d19cd0&gt;), name players, isOptional 1, isTransient 1, entity Team, renamingIdentifier players, validation predicates (
  ), warnings (
  ), versionHashModifier (null), fetchRequest &lt;NSFetchRequest: 0x6d1a080&gt; (entity: Player; predicate: (contract.team.name == SELF); sortDescriptors: ((null)); type: NSManagedObjectResultType; ) on 0x6d38550
  </code></pre>
  
  <p>...which makes no sense to me. I feel like I'm doing so many things wrong I don't even know where to begin tackling it.</p>
  
  <p>So I guess my questions are
  1) What type should this fetched property assume in my NSMO subclass. (I made it NSArray but apparently it's a NSFetchedPropertyDescription)
  2) What code can I use to get an array or set out?</p>
  
  <p>Thanks! Rob</p>