【发布时间】:2016-08-11 04:21:56
【问题描述】:
NSArray *sectionNames = [NSArray arrayWithObjects: @"aa", @"bb", nil];
RLMResults<Department *> *filteredDepartments = [Department objectsWhere:
[NSString stringWithFormat:@"SUBQUERY(sections, $section, $section.name IN %@).@count > 0",[NSArray arrayWithArray:sectionNames]]];
这是部门模型。
@interface Department : RLMObject
@property NSString *name;
@property (nonatomic, strong) RLMArray<Section> *sections;
@end
我有这个错误。 sectionNames 是 section 对象的名称数组。
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "SUBQUERY(sections, $section, $section.name IN (
)).@count > 0"'
【问题讨论】:
标签: objective-c realm