title: Can't access one-to-many relationships in CoreData using Swift
body: <p>Swift has gotten me to finally give IOS development a try, but I'm having some issues with CoreData. I'm having no luck trying to access my properties that map to my one-to-many relationships.</p>
  
  <p>I've got a one-to-many relationship set up as such:</p>
  
  <pre><code>@objc(Project)
  class Project: NSManagedObject {
  
      @NSManaged var name:String
  
      @NSManaged var scribbles : Array&lt;Scribble&gt;
  
  }
  
  @objc(Scribble)
  class Scribble: NSManagedObject {
  
      @NSManaged var notes:String
  
      @NSManaged var project:Project
  
  }
  </code></pre>
  
  <p>I fetch my data like this:</p>
  
  <pre><code>let request = NSFetchRequest(entityName: "Projects");
  request.returnsObjectsAsFaults = false;
  request.includesSubentities = true;
  
  var results:NSArray = context.executeFetchRequest(request, error: nil);
  for project in results
  {
       let thisProject:Project = project as Project;
       projects.append(thisProject);
  }
  </code></pre>
  
  <p>But whenever I try to iterate over the scribbles for a project using for..in  I get this exception:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Scribble count]: unrecognized selector sent to instance 
  </code></pre>
  
  <p>When I println on my project object It looks like I'm getting something back, I just don't know what to do with it.</p>
  
  <pre><code>&lt;Project: 0xb48e010&gt; (entity: Projects; id: 0xb48d340 &lt;x-coredata://CDEFAC19-4D9E-426D-B0CC-EFFEE9053707/Projects/p3&gt; ; data: {
  name = Larry;
  scribbles = "0xb48e7b0 &lt;x-coredata://CDEFAC19-4D9E-426D-B0CC-EFFEE9053707/Scribbles/p3&gt;";
  </code></pre>
  
  <p>})</p>