Predicate works with array controller but not fetch request

  • I have a Core Data app with an entity that contains a date attribute,
    called startTime.  I have a predicate defined as startTime >=
    "today".  If I apply that predicate to an array controller using
    setFilterPredicate, it works fine.  However, if I use the same
    predicate with NSFetchRequest, it does not work (returns an empty
    array).  My code for fetching the data using a NSFetchRequest is
    below.  Why does this predicate work with an array controller but not
    with a fetch request?  All other predicates I have used work with both
    the array controller and the fetch request.  Just not when the
    predicate is defined as startTime >= "today".  Does anyone know why?

    +(NSArray *)objectsForEntityName:(NSString *)name
      inContext:(NSManagedObjectContext *)context
    NSEntityDescription *entity = [NSEntityDescription entityForName:name
    NSFetchRequest *req = [[[NSFetchRequest alloc] init] autorelease];
    [req setEntity:entity];
    [req setPredicate:predicate];

    NSError *error = nil;
    NSArray *array = [context executeFetchRequest:req error:&error];
    return array;

    Thanks in advance,
previous month february 2008 next month
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29    
Go to today