IOS 使用 CoreData MR_findByAttribute
IOS use CoreData MR_findByAttribute
我正在使用 MagicalRecord
来保存我的数据。
我想得到 2 个列和 2 个值
所以,我不能使用这个方法:
[MyData MR_findByAttribute:(NSString *) withValue:(id)]
如何使用 2 个值的 2 列 MagicalRecord
请帮帮我!
您需要对 NSPredicate 使用另一种获取方法:
NSPredicate *filter = [NSPredicate predicateWithFormat:@"atribute1=%@ AND attribute2=%@", value1, value2];
NSArray *result = [Model MR_findAllWithPredicate: filter];
我正在使用 MagicalRecord
来保存我的数据。
我想得到 2 个列和 2 个值
所以,我不能使用这个方法:
[MyData MR_findByAttribute:(NSString *) withValue:(id)]
如何使用 2 个值的 2 列 MagicalRecord
请帮帮我!
您需要对 NSPredicate 使用另一种获取方法:
NSPredicate *filter = [NSPredicate predicateWithFormat:@"atribute1=%@ AND attribute2=%@", value1, value2];
NSArray *result = [Model MR_findAllWithPredicate: filter];