How to fetch a range of items from the database
问题 How do I fetch, say, item 7 000 to 7 999 in my SQLite table with around 100 000 items? The normal fetch returns to much to work with, and I rather fetch it little by little: NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Log" inManagedObjectContext:context]; [fetchRequest setEntity:entity]; NSArray *fetchedObjects = [context executeFetchRequest:fetchRequest error:&err]; // here fetchedObjects holds around 100