Closed PerfectShen closed 2 years ago
This is not a valid way of producing an NSPredicate, pass in the array literal instead e.g
[BusiModel objectsWhere:@"'name' IN %@", list]; or [BusiModel objectsWhere:@"'name' IN ['Foo', 'Bar']"];
See also: https://academy.realm.io/posts/nspredicate-cheatsheet/
How frequently does the bug occur?
All the time
Description
IN 关键字 格式化的时候有问题啊 NSArray *list = [@"1",@"2",@"3",@"4"]; listStr = [list componentsJoinedByString:@","];
[BusiModel objectsWhere:@"name IN {%@}",listStr]; 根本查不出来
Stacktrace & log output
Can you reproduce the bug?
Yes, always
Reproduction Steps
IN 关键字 格式化的时候有问题啊 NSArray *list = [@"1",@"2",@"3",@"4"]; listStr = [list componentsJoinedByString:@","];
[BusiModel objectsWhere:@"name IN {%@}",listStr]; 根本查不出来
Version
1.x
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
iOS14.7
Build environment
Xcode version: 12.5 Dependency manager and version: ... IN 关键字 格式化的时候有问题啊 NSArray *list = [@"1",@"2",@"3",@"4"]; listStr = [list componentsJoinedByString:@","];
[BusiModel objectsWhere:@"name IN {%@}",listStr]; 根本查不出来