title: iphone: NSPredicate problem with NSFetchedResultsController
body: <p>I currently have a 'Topic' entity defined in my system as:</p>
  
  <pre><code>@interface Topic :  NSManagedObject  
  {
  }
  @property (nonatomic, retain) NSString * path;
  @property (nonatomic, retain) NSString * name;
  @property (nonatomic, retain) NSNumber * topicID;
  @property (nonatomic, retain) NSNumber * parent;
  @end
  </code></pre>
  
  <p>I want to fetch a topic with a specific number (e.g. 4001) using an NSFetchedResultsController. I've defined mine as:</p>
  
  <pre><code>- (NSFetchedResultsController *)fetchedResultsController {
  
      if (_fetchedResultsController != nil) {
          return _fetchedResultsController;
      }
  
      NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  
      NSEntityDescription *entity = [NSEntityDescription entityForName:@"Topic" inManagedObjectContext:_context];
      [fetchRequest setEntity:entity];
  
      NSPredicate *predicate = [NSPredicate predicateWithFormat:@"topicID == 4100"];
      [fetchRequest setPredicate:predicate];
  
  
      NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"path" ascending:NO];
      [fetchRequest setSortDescriptors:[NSArray arrayWithObject:sort]];
  
      [fetchRequest setFetchBatchSize:20];
  
      NSFetchedResultsController *theFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:_context sectionNameKeyPath:nil cacheName:@"Root"];
      self.fetchedResultsController = theFetchedResultsController;
      _fetchedResultsController.delegate = self;
  
      [fetchRequest release];
      [theFetchedResultsController release];
  
      return _fetchedResultsController;    
  
  }
  </code></pre>
  
  <p>..Without the predicate, the FetchedResultsController works fine.. however, the moment I add it, there is an error and the app crashes.. can someone please tell me if I've defined my NSPredicate incorrectly? </p>