0
我有我的NSFetchRequest一個問題,它似乎並沒有被獲取任何數據,下面的代碼:核心數據 - NSFetchRequest問題
-(void)addAnnotations
{
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"WayPoint" inManagedObjectContext:managedObjectContext];
[request setEntity:entity];
//NSPredicate *predicate = [NSPredicate predicateWithFormat:@"waypoint_map_id=%i", 98];
//[request setPredicate:predicate];
NSError *error;
listArray = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy];
[request release];
NSLog(@"Array: ", listArray);
}
你應該使用' %@'而不是'%d'。 d代表整數,@代表對象。 – 2010-07-23 16:18:01