2014-01-26 2 views

답변

1
NSEntityDescription *entity=[NSEntityDescription entityForName:@"entityName" inManagedObjectContext:context]; 
    NSFetchRequest *fetch=[[NSFetchRequest alloc] init]; 
    [fetch setEntity:entity]; 
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(value1 == %@) AND (value2 == %@)", data1, data2]; 
[fetch setPredicate:predicate]; 
    //... add sorts if you want them 
    NSError *fetchError; 
    NSArray *fetchedData=[self.moc executeFetchRequest:fetch error:&fetchError]; 
for (NSManagedObject *product in fetchedProducts) { 
    [context deleteObject:product]; 
    } 
+0

고맙습니다. – mvasco

관련 문제