title: fetch request for entity.attribute == @"somevalue"
body: <p>How do I setup a fetch request to only pull the data from an entity's attribute with one particular value? This is the basic code I've used before.</p>
  
  <pre class="lang-m prettyprint-override"><code>-(void)fetchResults
  {
      NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:self.entityDescription.name];
      NSString *cacheName = [self.entityDescription.name stringByAppendingString:@"Cache"];
  
      // predicate code
      if (self.predicate != nil) {
          [fetchRequest setPredicate:self.predicate];
      }
      // end of predicate code
  
      NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
      [fetchRequest setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]];
  
      self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:cacheName];
  
      BOOL success;
      NSError *error;
      success = [self.fetchedResultsController performFetch:&amp;error];
      if (!success)
      {
          NSLog(@"%@", [error localizedDescription]);
      }
  }
  </code></pre>
  
  <p>I've been looking at this page: <a href="http://bit.ly/KevYwR" rel="nofollow">http://bit.ly/KevYwR</a> is this the right direction?</p>
  
  <p>Do I need to use <code>NSPredicate</code> or can I do without?</p>
  
  <p>Thanks for any help, point in the right direction, etc.</p>