coredataから最新の30レコードを取得したい、NSPredicateを使いたい:現在
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:managedContext];
[request setEntity:entity];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"((from == %@) AND (to == %@) )OR((from == %@) AND (to == %@))",from, to,to ,from];
[request setPredicate:predicate];
NSError *error = nil;
NSMutableArray *mutableFetchResults = [[managedContext
executeFetchRequest:request
error:&error] mutableCopy];
メソッドの追加方法