Wenn ich versuche, mehr als 1000 NSManagedObjects Abstürze von Core Data, meiner App mit dieser Nachricht zu holen:Kerndaten Absturz, wenn mehr als 1000 Abrufen von Objekten
error: (1) I/O error for database at .../Documents/Stores/Model.sqlite.
SQLite error code:1, 'Expression tree is too large (maximum depth 1000)'
CoreData: error: (1) I/O error for database at .../Documents/Stores/Model.sqlite.
SQLite error code:1, 'Expression tree is too large (maximum depth 1000)'
Der Code, den ich verwende, um die Objekte durch den Benutzer ausgewählt holen das ist:
NSManagedObjectContext *context = cdh.context;
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Spot" inManagedObjectContext:context];
NSError *error = nil;
[request setEntity:entity];
request.includesPropertyValues = NO;
NSMutableArray *subPredicatesArray = [NSMutableArray array];
for (NSString *string in uuidStrings)
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K like %@", @"sID", string];
[subPredicatesArray addObject:predicate];
}
NSCompoundPredicate *compoundPredicate = [NSCompoundPredicate orPredicateWithSubpredicates:subPredicatesArray];
[request setPredicate:compoundPredicate];
NSArray *fetchedObjects = [context executeFetchRequest:request error:&error];
gibt es eine bessere Art und Weise 1000 Objekte zu holen, die nicht dazu führen, wird meine Anwendung zum Absturz bringen?
ich nicht über diese Grenze nicht kannte. :) –
Ich auch nicht, bis ich darauf gestoßen bin! – EmilyP