NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"RSSEntryModel" inManagedObjectContext:_managedObjectContext];
[request setEntity:entity];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"articleDate" ascending:NO];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[request setSortDescriptors:sortDescriptors];
[request setFetchLimit:21];
[request setFetchOffset:_currentPage * 21];
NSArray *rssTemp = [_managedObjectContext executeFetchRequest:request error:&error];
core data 分页查询
最新推荐文章于 2024-09-28 16:08:32 发布