2010-02-11 4 views

Répondre

21

Utilisez ceci:

NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Friends" inManagedObjectContext:context]; 

NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease]; 

[request setEntity:entityDescription]; 

[request setPredicate:[NSPredicate predicateWithFormat:@"firstName == 'George'"]]; 
NSError *error = nil; 
NSArray *array = [context executeFetchRequest:request error:&error]; 
Questions connexes