title: cocoa, table view with core data datasource
body: <p>I am absolutely new to cocoa development so please don't chastise me for asking this.  </p>
  
  <p>Do I have to uses bindings? I know it saves a lot of code, but since I'm learning I'd really prefer to set everything up in the code.  </p>
  
  <p>My goal is to populate a table view with the entities I fetch from core data.  I've created a custom controller class for my main window view.  I also have some code to fetch my category entites</p>
  
  <pre><code>NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  NSEntityDescription *entity = [NSEntityDescription
                                 entityForName:@"Category"
                                 inManagedObjectContext:[self managedObjectContext]];
  [fetchRequest setEntity:entity];
  
  NSError *error = nil;
  NSArray *fetchedObjectsArray = [[self managedObjectContext] executeFetchRequest:fetchRequest error:&amp;error];
  if (fetchedObjectsArray == nil) {
      NSLog(@"Error occured fetching categories: %@", error);
  }
  
  
  for (Category *cat in fetchedObjectsArray) {
      NSLog(@"categories %@", cat.name);
  }
  </code></pre>
  
  <p>I know I have to implement the delegates for my table view, but I'm kinda lost on where to put my fetch code so the table view 1. has access to it and 2. uses the data returned from my fetch request.</p>