iPad: CoreData FetchedRequest Ignores Changes in Predicate
        Posted  
        
            by Michael
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Michael
        
        
        
        Published on 2010-06-03T14:26:47Z
        Indexed on 
            2010/06/03
            16:04 UTC
        
        
        Read the original article
        Hit count: 359
        
Hi there,
While programming an iPad-app, I'm just running into trouble using a fetchedResultsController with a "dynamic" predicate. it seems the changes to the predicate get ignored. No matter how the predicate changes, I always get the result of the first fetch ...
same code runs without no problems on iphone-env (3.1.x) !!
sample :
- (void)performSearch:(NSString *)searchText {
  self.displaySearchResults = TRUE;
  NSPredicate *predicate = [NSPredicate predicateWithFormat:@"searchWords contains[cd] %@", searchText];
  [self.fetchedSearchResultsController.fetchRequest setPredicate:predicate];
  NSError *error = nil;
  if (![self.fetchedSearchResultsController performFetch:&error]) {
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
    abort();
  }
  if(deviceIsIPad) {
    [self showSearchResults];
  }  
  else {
    [cookBookOverview reloadData];
  }
}
can anyone help plz ?
btw.: excuse my painful english ;-)
© Stack Overflow or respective owner