-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
I am trying to enumerate a database finding only the values that match a given predicate.
Here is my code:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY SELF.names BEGINSWITH[cd] %@", searchText];
@autoreleasepool {
[self.datastore enumerateKeysAndObjectsBackward:NO
lazily:NO
startingAtKey:nil
filteredByPredicate:predicate
andPrefix:nil
usingBlock:^(LevelDBKey *key, id value, BOOL *stop){
[self.searchResults addObject:value];
}];
}
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self.searchDisplayController.searchResultsTableView reloadData];
}];
The thing is that while enumerating Objective-LevelDB keeps all values in memory, even the ones that don't match the predicate. Not even lazy evaluation solves the issue here.
Am I doing something wrong? Can something be done to improve on memory usage?
Metadata
Metadata
Assignees
Labels
No labels