From cb7ac954bb1931e95e4940a9fc0b5b290d491760 Mon Sep 17 00:00:00 2001 From: Jeff Lockhart Date: Sat, 26 May 2018 14:24:09 -0600 Subject: [PATCH] Use keys in dictionary if value for IN operator This is the way the default NSSQLiteStoreType behaves. Iterating over an NSDictionary iterates over its keys as well. --- Incremental Store/EncryptedStore.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Incremental Store/EncryptedStore.m b/Incremental Store/EncryptedStore.m index aa7a382..6b2ebe7 100755 --- a/Incremental Store/EncryptedStore.m +++ b/Incremental Store/EncryptedStore.m @@ -4112,6 +4112,14 @@ - (void)parseExpression:(NSExpression *)expression [operator objectForKey:@"format"], [parameters componentsJoinedByString:@", "]]; } + else if ([value isKindOfClass:[NSDictionary class]]) { + NSUInteger count = [value count]; + NSArray *parameters = [NSArray cmdArrayWithObject:@"?" times:count]; + *bindings = [value allKeys]; + *operand = [NSString stringWithFormat: + [operator objectForKey:@"format"], + [parameters componentsJoinedByString:@", "]]; + } else if ([value isKindOfClass:[NSDate class]]) { *bindings = value; *operand = @"?";