title: How to create and fetch relational records in core data
body: <p>Total newbie question now... Suffice to say, I have searched for a completely noddy explanation but have not found anything 'dumb' enough. The problem is...</p>
  
  <p>I have created a core data stack in which I have a entity called 'Client' and an entity called 'Car'. It is a one-to-many relationship.</p>
  
  <p>So far i have successfully created and fetched the client list using code from apple's tutorial. Once I select a client, I then push a new tableViewController which should list the Cars for that chosen client.</p>
  
  <p>First question...</p>
  
  <p>I am used to sql style database programming where if I wanted to add a car to a client, I would simply add a 'ClientID' tag to the 'Car' record thereby providing the relationship to a specific client. How do I do the equivalent in core data? My understanding from my reading is adding attributes to point to other entities isnt necessary - core data maintains this relationship for you without needing additional attributes in the entities.</p>
  
  <p>Second question...</p>
  
  <p>As and when I have created a 'car' entity and successfully linked it to a 'Client'. How to I create a fetch which will retrieve just THAT client's cars. I could alter the code from apple to fetch ALL cars but I don't know how to fetch cars associated with a given client.  From my reading, I think I need to use predicates, but apples predicate documentation stands alone and does not give clear guidance on how to use it with core data</p>
  
  <p>I realise how noddy this is, but I cant find an idiots guide anywhere...</p>
  
  <p>Any help/code exmaples much appreciated.</p>