我想从核心数据中获取最后 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];
如何添加方法